# How to check how long an actor has been spawned

**URL:** <https://forums.unrealengine.com/t/how-to-check-how-long-an-actor-has-been-spawned/317013>\
**Category:** Blueprint\
**Tags:** actor, overlap, unreal-engine, Blueprint, question\
**Created:** [April 30, 2015, 8:47pm UTC](https://forums.unrealengine.com/t/how-to-check-how-long-an-actor-has-been-spawned/317013 "2015-04-30T20:47:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mikhael](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mikhael](https://forums.unrealengine.com/u/Mikhael)\
**Post date:** [April 30, 2015, 8:47pm UTC](https://forums.unrealengine.com/t/how-to-check-how-long-an-actor-has-been-spawned/317013/1 "2015-04-30T20:47:14Z")

</div>

Hello,

I’m trying to create to type of actors that overwrite each other (dots on the ground at the moment). But I want them to destroy the other only if the other is older ( so that both don’t get destroyed every time they overlap)

Thank you !

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_10b2fd67](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_10b2fd67](https://forums.unrealengine.com/u/anonymous_user_10b2fd67)\
**Post date:** [April 30, 2015, 8:57pm UTC](https://forums.unrealengine.com/t/how-to-check-how-long-an-actor-has-been-spawned/317013/2 "2015-04-30T20:57:15Z")

</div>

I think the simplest way to do this is just to add a FDateTime variable (call it “Lifetime” or some such) to your actor. When your actor is constructed you can just set that variable to FDateTime::Now(), then just compare the two actors lifetimes when a collision happens and run whatever logic you want.

---

<div class="post-metadata">

**Author:** ![Mikhael](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mikhael](https://forums.unrealengine.com/u/Mikhael)\
**Post date:** [April 30, 2015, 11:10pm UTC](https://forums.unrealengine.com/t/how-to-check-how-long-an-actor-has-been-spawned/317013/3 "2015-04-30T23:10:32Z")

</div>

Thank you, that would certainly work. One thing I can’t seem to succeed to do is compare the actor variable to one of the actor not yet created. I can’t cast it from the overlap node, since it’s a generic node. Not sure if I’m clear here, all in all I’m just not sure how to compare the two on the overlap occurred.

---

<div class="post-metadata">

**Author:** ![wukakuki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/wukakuki/32/1134338_2.png) [@wukakuki](https://forums.unrealengine.com/u/wukakuki)\
**Post date:** [April 24, 2018, 3:34pm UTC](https://forums.unrealengine.com/t/how-to-check-how-long-an-actor-has-been-spawned/317013/4 "2018-04-24T15:34:50Z")

</div>

[Get Game Time Since Creation](http://api.unrealengine.com/INT/BlueprintAPI/Actor/GetGameTimeSinceCreation/index.html)

---

<div class="post-metadata">

**Author:** ![El\_Delfinito](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@El\_Delfinito](https://forums.unrealengine.com/u/El_Delfinito)\
**Post date:** [August 17, 2023, 9:31pm UTC](https://forums.unrealengine.com/t/how-to-check-how-long-an-actor-has-been-spawned/317013/5 "2023-08-17T21:31:12Z")

</div>

> **[Get Game Time Since Creation](https://docs.unrealengine.com/4.26/en-US/BlueprintAPI/Actor/GetGameTimeSinceCreation/)**
>
> Get Game Time Since Creation
