BP Error

Hello there,

I have a simple BP which is like shown in the picture below. All works fine, but I get this error when I play the level:

Error Cannot access ‘Cube’. It is pending kill. Property: ‘Cube’ from node SetRelativeLocation in graph ‘EventGraph’ in blueprint Force_PUSH_Side

Even if the result ingame is ok, I don´t like (and trust) errors, someone an idea?

85391f2abdfe6f194a5ba3c7bc583dee80147c9a.jpeg

You have “destroy” somewhere or lifetime is short (not 0). So cube is on list to kill and you trying to access it.
Kill it after you use it.

Thanks Nawrot,

So, yeah, what I´m trying to do is a cube which collides with another object to produce a collision, making the second object fly towards the player hitting him.

So I made my “destroy cube” at the end of the sequence, but I still get the same error. The cube ist just used as an “force push” object, thats why I want to destroy it when it hits something. Maybe there is a better way to do something like that anyways…:wink:

15747707ac16453d6ae742e93e654169f81d0816.jpeg

The red object falls into the overlap box of the BP shown, making the cube on the right moving into its trajectory, hitting it (green “flash”) and let the physics do the rest…:

ed45fd2bbf3261af0f39b890991b77eb03e8f278.jpeg

Try to connect your destroy node with the finished node of the timeline. In your current setup it is destroyed during your first timelineupdate. Thats why it can not finish and gets you this error.

Hey,

I have tried that, didn´t change the error:

beb436bb8b01cb07559455a40ecd83a893b56756.jpeg
ed585e0d8f60b945528a1db70738ff920a149c81.jpeg

Also, you can use the ‘Is Valid’ macro to ensure that you aren’t accessing anything pending kill (that will remove the error, but not the underlying issue- you should figure out why it’s pending kill while still in use). That being said your method should work. I’d just use physics for that: Content Examples Sample Project for Unreal Engine | Unreal Engine 5.1 Documentation in particular the thruster, and then use an ‘On Hit’ event to destroy the thruster, and delay for a bit before destroying the actor itself. It’d make your box more re-usable without having to change the location you lerp to.