Hi guys, I have ran into an issue while learning game development and design in Unreal Engine 5.
I have tried looking everywhere but I unfortunately could not find the answer. I have built a very basic third person game with a couple of variables, such as “Health” that is influenced by “Thirst”, “Hunger” and “Rescue”. The longer the player survives, the more the “Rescue” variable rises and I set it up so that if it is 100 or greater, then it should trigger an animated sequence to play, signaling that the player has won and that the game is over.
But whenever the bar fills up, nothing happens.
I would greatly appreciate any help as my knowledge is very limited
Click the “Set Won” node, and press F9 to set a breakpoint.
Start the game (perhaps changing the rescue timer to increase faster.)
When you get to “rescue” mode, does the value get set? It looks like it should.
If so, then the next quesiton is: What code is responsible for checking the “Won” value, and doing something different when it’s set?
Put a breakpoint there, and see whether it correctly picks up this value, and does the right thing.
Begin Play executes only once when you start the level.
Best practice would be calling an explicit function (“custom event”) to play the cinematic when conditions are met.
But looking at your “tick->delay gating technique” I think event timers need to be added to ‘your toolbox’
With this, you can fire that chain of logic every 3 seconds to see if ‘Won’ is true. (Also you could use this to fire a ‘Increment rescue’ or ‘decrement thirst’ sort of function every x seconds.)