How do i fix this blueprints error

Error Blueprint Runtime Error: Attempted to access BOX-YOU-DEAD2_794 via property box-u-dead, but BOX-YOU-DEAD2_794 is pending kill from function: ‘ExecuteUbergraph_BOX-TARGET-TO-U-DEAD’ from node: AddActorLocalOffset in graph: EventGraph in object: BOX-TARGET-TO-U-DEAD with description: Attempted to access BOX-YOU-DEAD2_794 via property box-u-dead, but BOX-YOU-DEAD2_794 is pending kill

2 Likes

If you are going to call DestroyActor on your variable box-u-dead you need to make sure that where ever you GET the variable you pass it through the “IsValid?” node. Otherwise you will see this error after you destroy an actor and then somewhere in your code you try to access the old actor reference after it’s been “Destroyed”.

My rule of thumb is: when ever you access a variable or parameter that you expect to have an instance of an actor make sure you call the “IsValid?” node on it first to avoid these errors.

Basically, what the game engine does when you call DestroyActor is flags the given actor as “Pending Kill” and hides it from the world instead of deleting it immediately. The purpose for this is because it let’s the garbage collection actually delete Actors that have been flagged as Pending Kill.

2 Likes