# \[Solved\] How to put a timer that work inside a collision box (but not outside)

**URL:** <https://forums.unrealengine.com/t/solved-how-to-put-a-timer-that-work-inside-a-collision-box-but-not-outside/469322>\
**Category:** Blueprint\
**Tags:** box-collision, timer, unreal-engine, Blueprint, question, box-overlap\
**Created:** [August 6, 2020, 6:24pm UTC](https://forums.unrealengine.com/t/solved-how-to-put-a-timer-that-work-inside-a-collision-box-but-not-outside/469322 "2020-08-06T18:24:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daedalvs\_Design](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Daedalvs\_Design](https://forums.unrealengine.com/u/Daedalvs_Design)\
**Post date:** [August 6, 2020, 6:24pm UTC](https://forums.unrealengine.com/t/solved-how-to-put-a-timer-that-work-inside-a-collision-box-but-not-outside/469322/1 "2020-08-06T18:24:20Z")

</div>

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) :

 ![309410-blueprint.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/d/b7d5a7b75869511f942d0084ffe095ffcc6f65a9.jpeg)

Thank you very much !

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [August 6, 2020, 7:33pm UTC](https://forums.unrealengine.com/t/solved-how-to-put-a-timer-that-work-inside-a-collision-box-but-not-outside/469322/2 "2020-08-06T19:33:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Daedalvs\_Design](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Daedalvs\_Design](https://forums.unrealengine.com/u/Daedalvs_Design)\
**Post date:** [August 7, 2020, 2:13pm UTC](https://forums.unrealengine.com/t/solved-how-to-put-a-timer-that-work-inside-a-collision-box-but-not-outside/469322/3 "2020-08-07T14:13:43Z")

</div>

Hey ! You’re back to help me ahah  
So I did it but where do I plug the “event” output ?

---

<div class="post-metadata">

**Author:** ![talislincoln](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@talislincoln](https://forums.unrealengine.com/u/talislincoln)\
**Post date:** [August 7, 2020, 2:41pm UTC](https://forums.unrealengine.com/t/solved-how-to-put-a-timer-that-work-inside-a-collision-box-but-not-outside/469322/4 "2020-08-07T14:41:22Z")

</div>

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.

 ![309468-timer-ex.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/e/3/4e3906a21f9f97b8f834cbee7fee89d186f6a9a1.png)

---

<div class="post-metadata">

**Author:** ![Daedalvs\_Design](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Daedalvs\_Design](https://forums.unrealengine.com/u/Daedalvs_Design)\
**Post date:** [August 7, 2020, 3:00pm UTC](https://forums.unrealengine.com/t/solved-how-to-put-a-timer-that-work-inside-a-collision-box-but-not-outside/469322/5 "2020-08-07T15:00:50Z")

</div>

Yes ! It worked ! Thank you very much to you both 🙂  
Have a nice day

---

<div class="post-metadata">

**Author:** ![CorruptClaw08](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CorruptClaw08](https://forums.unrealengine.com/u/CorruptClaw08)\
**Post date:** [April 22, 2024, 8:18am UTC](https://forums.unrealengine.com/t/solved-how-to-put-a-timer-that-work-inside-a-collision-box-but-not-outside/469322/6 "2024-04-22T08:18:51Z")

</div>

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”.
