Hi Everyone, in a part of my game, when the player enters a trigger, a one-minute timer is activated, when it reaches one minute, the player dies, I already made a Trigger with the logic that at the end one minute it dies, but for this, the player has to find a shelter, so that in less than a minute he can continue the game and not die, my question is, how could I make the player when he reaches the shelter, deactivates the timer so the player continues the game, without dying.
Hey there @Akame831! Welcome to the community! So this answer is kind of a conditional one. So, if you want your logic to remain on on the timer and just set a bool to turn the timer off, you’ll have to get a reference to it one way or another. So if your game has just one of these objects altogether, you can get that reference pretty easily from anywhere in the level.
Say when you collide with the safety volume, it activates this.
This validates, checks if the timers running, and then lets you cast to the timebombvolume (The car is the bomb in this example), to tell it to cancel the timer with this node:
Now if there’s only one you could have hard refs off the bat, but this is a slightly more modular way to go about it.
If you’ve got a system with multiple of these, or if it’s looping, or one of the many ways this is complicated this may not be the best system.
Let me know if you have any questions!
Hi @Akame831, here’s a suggestion only using one timer. As you already use a timer for the display update, why not use this for the overall logic?
In your player Character, implement this one: here, K key simulates the trigger on entry of the danger area. And finding shelter triggers custom event ShelterFound, which stops the countdown. Your Widget Update is just shown as a simple print string here…