Problem with projectile - Collision Component is pending kill

Hello

I have error log. In game nothing bad happens, but I have error message like this:

Error Blueprint Runtime Error:
Attempted to access CollisionComponent
via property K2Node_Event_OtherComp,
but CollisionComponent is pending kill
from function:
‘ExecuteUbergraph_BulletProjectile’
from node: Branch in graph: EventGraph
in object: BulletProjectile with
description: Attempted to access
CollisionComponent via property
K2Node_Event_OtherComp, but
CollisionComponent is pending kill

How to avoid this?

Thank you

This question is need to be answered. I’m having lags because of the same error, I don’t know why this error pops up.

I have exactly the same problem…do you have any idea how to solve it?

Are you using the event Hit on your projectile?

I am using EventHit and also Event ActorBeginOverlap…

I’m closing it now, this is very old question. Now I use a lot IsValid check - when you put it on projectile it will work only when is valid, means exists in world and not begin destroy. If is or will be destroyed, you not need additional actions, so it will be ignored and no more error messages like this. IsValid check is very important and it should be used in many other situations where actor, projectile etc can be destroyed and not only. Sometime it is not yet created and game code can want to do something with object, so before is good to add IsValid.

Return true if the object is usable : non-null and not pending kill
This can be pure or normal.

Thank you, it works but now I have another similar problem: Spawned emitter attached spawned potentially immortal particle. Is there any solution for this?

Two solutions, I use both sometimes for same particle.
First and correct way is set particle lifetime (in particle editor). Here various settings. And on create check Auto Destroy [x].
Second - destroy it manually after time or before creating new one. I have it for gun muzzle, it have lifetime but with abusive spawn it sometimes can’t be destroyed normal way. So I have it as variable - after spawn, set variable from this particle. Then, when you will spawn new one same type, to not overlap do another test IsValid. If this particle variable is valid - destroy it and set variable as none.

Here how it looks. I have custom event destroy after time. But this event is also fired before another shot, if particle is valid. I’m not sure this is best solution, but works as expected and I have no issues with it.

https://i.imgur.com/4vBTHgC.png?1