# Destroying an Actor but Still Recieving Commands: Runtime Errors

**URL:** <https://forums.unrealengine.com/t/destroying-an-actor-but-still-recieving-commands-runtime-errors/2682876>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [December 7, 2025, 4:00pm UTC](https://forums.unrealengine.com/t/destroying-an-actor-but-still-recieving-commands-runtime-errors/2682876 "2025-12-07T16:00:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![LumaraIG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LumaraIG](https://forums.unrealengine.com/u/LumaraIG)\
**Post date:** [December 7, 2025, 4:00pm UTC](https://forums.unrealengine.com/t/destroying-an-actor-but-still-recieving-commands-runtime-errors/2682876/1 "2025-12-07T16:00:06Z")

</div>

On actor destruction in the character blueprint, two issues have come up in different blueprints. One in the HUD class, and the other in the Player Controller class. I know the issue is with the process, once an actor is destroyed the prior blueprints still issues commands to the now destroyed unit. I’ve tried fixing this in the Character and Player Controller blueprint but can’t find a solution.

The chain is the following:

Player Controller (for inputs) → HUD (to select units) → Player Controller (move selected) → Character Class (moves, displays selection, and destroys when HP reaches zero)

![Runtime Error](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/b/c/6bcd272a6a74bf9bb9a292ffd33ac928c705bb94.png)

 ![Player Controller: Move Selected](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/a/8/aa86d9304887f0055c3723d73b66e6a6419de64a.png)

 ![HUD Class: Selecting and Deselecting Units](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/6/1/a61e99a38ad0bdf9a57625aa8abcd9ca432723b0.png)

 ![Character Class: Deselect and Destroy Actor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/3/b/13b7657448fe9ad68deabc23fe8cc69726149b7e.png)

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [December 7, 2025, 11:11pm UTC](https://forums.unrealengine.com/t/destroying-an-actor-but-still-recieving-commands-runtime-errors/2682876/2 "2025-12-07T23:11:06Z")

</div>

Hey there @LumaraIG! When an actor is destroyed, they can still technically receive calls before garbage collection kicks in. If possible, I would wrap any functions/events that are called to or from actors that aren’t persistent (anything that will be destroyed) in `IsValid` checks. This will stop this issue from occurring, while also allowing you to handle failed orders.

Another recommendation would be to modify the selection array to remove any element that isn’t valid when you issue commands or create an event listener to subscribe and listen out for when those actors are destroyed and remove them from from the array.

---

<div class="post-metadata">

**Author:** ![LumaraIG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LumaraIG](https://forums.unrealengine.com/u/LumaraIG)\
**Post date:** [December 8, 2025, 2:55pm UTC](https://forums.unrealengine.com/t/destroying-an-actor-but-still-recieving-commands-runtime-errors/2682876/3 "2025-12-08T14:55:10Z")

</div>

Hey, thanks for the response! I’ve tried what you suggested with the IsValid command but still receive the error. I’ve plugged the node into every part of the code to no effect.

 ![Moving Unit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/0/100c4a2681d6fdb2743ae29711a2c35127f69915.png)

 ![Deselecting Unit](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/0/a/a0a160ed7ab633a10e0b6716c455c4967e9c102b.png)

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [December 9, 2025, 1:13am UTC](https://forums.unrealengine.com/t/destroying-an-actor-but-still-recieving-commands-runtime-errors/2682876/4 "2025-12-09T01:13:35Z")

</div>

you have to plug the array element into the IsValid Object, you may also want to log a IsNotValid message since really this is just hiding potential errors

---

<div class="post-metadata">

**Author:** ![LumaraIG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LumaraIG](https://forums.unrealengine.com/u/LumaraIG)\
**Post date:** [December 9, 2025, 1:51am UTC](https://forums.unrealengine.com/t/destroying-an-actor-but-still-recieving-commands-runtime-errors/2682876/5 "2025-12-09T01:51:30Z")

</div>

Thanks! That got rid of the error messages, but I noticed that the print string will still send the movement commands until I deselect the destroyed actors. I’m not sure when the garbage is collected or if it will matter. Really don’t want things to stay loaded when destroyed lol.

 ![move](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/0/d40092a1581965df7436bca9d4a78e6ed4233388.png)

 ![selection](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/e/47e125122e6aaa62fda5dbd8c9a1486c66508882.png)

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [December 9, 2025, 9:40am UTC](https://forums.unrealengine.com/t/destroying-an-actor-but-still-recieving-commands-runtime-errors/2682876/6 "2025-12-09T09:40:18Z")

</div>

The garbage collector will eventually get actors once they are destroyed as long as the game tick isn’t struggling too hard at the time. You will still have to remove destroyed actors from the array. You could do this when the valid check fails if you don’t want to set up a method for listening for the deaths, then you could finish processing the array.

---

<div class="post-metadata">

**Author:** ![LumaraIG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LumaraIG](https://forums.unrealengine.com/u/LumaraIG)\
**Post date:** [December 9, 2025, 5:09pm UTC](https://forums.unrealengine.com/t/destroying-an-actor-but-still-recieving-commands-runtime-errors/2682876/7 "2025-12-09T17:09:45Z")

</div>

Worked perfectly, thanks for the help you two!

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/8/c/b8c7448dcaeb0d5f87e3bc9c789e041b36d84142.png)

---

<div class="post-metadata">

**Author:** ![Auran131](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Auran131](https://forums.unrealengine.com/u/Auran131)\
**Post date:** [December 10, 2025, 3:30am UTC](https://forums.unrealengine.com/t/destroying-an-actor-but-still-recieving-commands-runtime-errors/2682876/8 "2025-12-10T03:30:39Z")

</div>

just be careful altering an array mid loop, will likely cause errors. best way is to cache the array to a local variable

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [December 10, 2025, 4:52am UTC](https://forums.unrealengine.com/t/destroying-an-actor-but-still-recieving-commands-runtime-errors/2682876/9 "2025-12-10T04:52:15Z")

</div>

Great work! The only note I have is the same point Auran made, try to do any modification to the array before actually running the data, as in rare edge cases, you may run into some issues. Caching a local variable copy of the array (post modification but pre-firing of commands) should eliminate most of these edge cases, with the overhead of running two copies of usually identical data.
