# Is there a way to reset an actor to the state it was in when it spawned?

**URL:** <https://forums.unrealengine.com/t/is-there-a-way-to-reset-an-actor-to-the-state-it-was-in-when-it-spawned/447559>\
**Category:** Blueprint\
**Tags:** actor-blueprint, reset-to-default, unreal-engine, question, Blueprint\
**Created:** [April 20, 2019, 10:24pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-reset-an-actor-to-the-state-it-was-in-when-it-spawned/447559 "2019-04-20T22:24:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![N0rgannon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@N0rgannon](https://forums.unrealengine.com/u/N0rgannon)\
**Post date:** [April 20, 2019, 10:24pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-reset-an-actor-to-the-state-it-was-in-when-it-spawned/447559/1 "2019-04-20T22:24:56Z")

</div>

Hello !

What I would like to achieve is to reset the enemies in my level when the player character reaches a `save point trigger`.

I wondered if there is an already built-in way to tell a enemy ( `Actor`) to reset to its original state (internal variables, position, rotation…). Alternatively (or even better actually), is there a way to spawn a duplicate of the enemies in my level (as they were when the level was spawned) while keeping the ones that were previously spawned still alive and well ?

The `Reset Level` doesn’t seem to be what I am looking for (even though I don’t really understand its purpose) and the `Open Level` is too brutal (it loses everything statewise). The individual `Actors` don’t seem to have a `Reset` method built-in but I guess in the worst case scenario I could build one by storing the initial information when they spawn to be able to reset them later manually.

Do you have any insight into if it is actually possible to achieve my goal using built-in methods at some level ?

Thanks a lot for your help !

---

<div class="post-metadata">

**Author:** ![linden1029](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@linden1029](https://forums.unrealengine.com/u/linden1029)\
**Post date:** [April 21, 2019, 8:26am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-reset-an-actor-to-the-state-it-was-in-when-it-spawned/447559/2 "2019-04-21T08:26:46Z")

</div>

I don’t know of anything one node that would help. The way I would do it is just have a struct for all the variables you want saved and store that in the game state. Then you can reset the level and call on that info. Not sure if that helps.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 21, 2019, 9:20am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-reset-an-actor-to-the-state-it-was-in-when-it-spawned/447559/3 "2019-04-21T09:20:18Z")

</div>

Get Class → Get Class defaults will get you the original variable values. Write a small reset function in the base class and restore them. Should work for something straightforward.

* * *

Or give the actor a default struct and a modifiable struct. When you want to reset the actor, set the modifiable struct to the the default one (or fetch one from a data table). You will still need custom functionality to restore things that are _your game specific_, ofc.

* * *

Another good method applicable to more complex setups is to envelop variable sets / structs with components. You can then have the components reset themselves (call their own reset functions that you wrote) without worrying about inheritance. More upfront work and way more planning here but you reap the benefits further down the line.

It depends heavily on what your game is atm and where you’re taking it next.

---

<div class="post-metadata">

**Author:** ![N0rgannon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@N0rgannon](https://forums.unrealengine.com/u/N0rgannon)\
**Post date:** [April 21, 2019, 2:26pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-reset-an-actor-to-the-state-it-was-in-when-it-spawned/447559/4 "2019-04-21T14:26:39Z")

</div>

I think that’s just what I’ll do for a start and improve upon that when I get the time ! Thanks for sharing your insight ! 🙂

---

<div class="post-metadata">

**Author:** ![N0rgannon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@N0rgannon](https://forums.unrealengine.com/u/N0rgannon)\
**Post date:** [April 21, 2019, 2:26pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-reset-an-actor-to-the-state-it-was-in-when-it-spawned/447559/5 "2019-04-21T14:26:41Z")

</div>

That is kind of what I had in mind but better explained. I’ll try to look into the component envelope when I get the time. For the start, a simpler original state struct, as suggested, would be working fine I guess. Thanks for your insights ! 😃

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [April 21, 2019, 6:12pm UTC](https://forums.unrealengine.com/t/is-there-a-way-to-reset-an-actor-to-the-state-it-was-in-when-it-spawned/447559/6 "2019-04-21T18:12:49Z")

</div>

Yeah, structs work well - especially that you might want to save that data anyway, as you mentioned!

The components are useful when you build something big and modular. You can then keep some of the reusable functionality there. You’d actually combine that with structs.

---

<div class="post-metadata">

**Author:** ![Crazysoham11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crazysoham11](https://forums.unrealengine.com/u/Crazysoham11)\
**Post date:** [September 28, 2024, 11:09am UTC](https://forums.unrealengine.com/t/is-there-a-way-to-reset-an-actor-to-the-state-it-was-in-when-it-spawned/447559/7 "2024-09-28T11:09:18Z")

</div>

hi,  
i also wanted to do something same and looked up internet but didn’t find a thing. here is the code

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/5/d952c4cdfeb4f30d55a745ef304d0da7edde2f86.png)
