r/unrealengine Dec 06 '24

pending kill "ruining" my BP logic. Solved

so on begin play, im getting all actors with a tag, making an array and applying a constraint to all actors in the array.
then in game i have a variable that sets the linear and angular drive of the constraint in a loop to that array.
so i can essenatily have a spring like effect, and turn it on and off.

ocasiuonaly when im going from 0 drive to 1 (for example) some objects dont react, unless they are "pushed/moved".

then when i exit play i get the obect X was pending kill or garbage, menaing for some reason that object is being recognized as destroyed or whatnot, and then its being removed from the array?
but why? and how do i avoid this, thanks!!

SOLVED: I added a wake all rigid bodies and now its solved

1 Upvotes

View all comments

1

u/CloudShannen Dec 06 '24

Use a IsValid or Validated Get before using any Reference / Pointer to confirm it still exist and isn't Pending Kill etc