I have an issue where in starting the scene, I set a player variable, as well as a progress bar to that variable (after the variable is set of course) and when I have an event to test that the variable is at or below zero, it changes layout scenes, but its changing even if the variable is above 0.
The variable is Player.playerHealth.
I set it at start of layout to the value of 100.
I then set the progress bar "progress" to Player.playerHealth afterwards.
I have a text to show the value of Player.playerHealth, which shows 100. And the progress bar turns full green.
ok, so far so good.
Upon taking damage, the progress, player variable, and the text all change accordingly, and all three show the numeric value taken away appropriately.
great. now here is the issue.
When I then have an event to say if either Player.playerHealth OR the healthbar is < or = 0, then do a "player dead" situation and go to menu (basically just waits 3 seconds atm until I can put animations in there, then goes to menu).
It doesnt wait until the event is triggered for health to take action. It just goes to main menu every start of the game after 3 seconds as if the even was blank. And none of this is a sub event of start of layout.