Hi everyone !
So, I want that the player stay in the collision box for a certain time before the door get unlocked. I already did all the BP for that except for the time.
I put a delay before it unlock the door but even if we go outside the collision box, naturally it still unlock the door.
I want that we need to stay 5 second in the collision box so the door unlock and if we get out it before the 5 seconds, it reset that time.
Here is the blueprint of my collision box (as you can see I put the delay but as I said, it doesn’t work like that ahah) :
Thank you very much !
When they step into the box, use the node ‘SetTimerByEvent’ with a 5 second delay. Promote the output to a variable ( like MyTimer ), and connect the node to the open door event.
If they step out of the box before the door opens, just use the MyTimer variable connected to a ClearAndInvalidateTimerByHandle node to stop it.
Here’s an example of how you could achieve what has been said. You can keep a reference of the timer as a variable to clear and destroy it after if the player leaves the box.
Yes ! It worked ! Thank you very much to you both
Have a nice day
Hey ! You’re back to help me ahah
So I did it but where do I plug the “event” output ?
Would that work if I want to have a timer for a Print String that brings up on the screen and explain what the area is like? For example, I have a box collision over a skeleton, made the box collision is a bit bigger then the skeleton, and when the player enters the box collision, the Print String pops up and explain like “This skeleton looks quite old, just like it have been like this for under centauries”.