Greetings program!
Most of what Ive read regarding ''actor destroy is pending" errors, an ‘index valid’ node is used but isnt working in my BP. I know its valid because it destroys the actors. I think the Event Tick is too fast and is calling destroy actor after its executed but before its completed. I’ve seen some suggestions to use ‘Play Timeline’ various times. Anyone have any other way of getting event ticks that are slower?
Anyone have any other way of getting event ticks that are slower?
if your just trying to slow the tick rate then you could go into the class defaults (button near top) then in the details panel under actor tick change the interval.
otherwise you may need to modify your script and we would need to see the bp in that case.
thats a pretty bad way to get a reference to something. im talking about using the get all of class then get 0, its not guaranteed to return the actor that you want and its also poor performance wise (even more so on tick). the cast is also redundant hence the note, basically by using the actor class filter on the get all of class you already specified the class you want so theres no need to identify it again.
now about your actual question, you don’t really show whats happening (what the bp does) or where the destroy actor reference is coming from. All we can really tell from your screenshot is that your getting a actor DMGrid and checking a bool value it contains then destroying something.
I would imagine based on the script posted that theres probably a better way to go about accomplishing the task your attempting rather than relying on tick and get alls. tell us about what your attempting here and maybe we can help you to a better solution.
Im getting a variable from the DMGrid BP and, when true, will activate the function DestroyActor; the actors are listed in an array.(Target not shown). Simple.
It works as it should, perhaps having one “Get” w/index may be redundant but a note is just a note. So says Epic anyway. The errors generated refer to the actors in an array in the target DestroyActor. Error states: Attempted to access “actor_c” via property CallFunc_Array_Get_Item, but 'actor_c" is pending kill from function: etc etc.
Apparently, there is one frame where an actor is ‘pending kill’ between the execution and completion. Even if I slowed the tick rate to 1 second. Error still returns on destroyed actors.
Only reason I use event tick is, I can get the value of a variable instantly.
Before you destroy the actor you could call SetActorTickEnabled
and disable it. It is more of a workaround than a solution though since something like this should not be done on Tick.
Truly, the blueprint should flow.
How would you destroyactor? BindEvent?
I’ve been looking at arrays but again am getting the same trouble casting to another actor BP.
More errors.Not just the pending kill error.
I’ve reworked this blueprint so I am not using an event tick to get a variable from another actor blueprint (which is all I need). I am also avoiding using ‘Get all actors of class’ with a ‘Get 0’ index. No errors. However, I still need a single variable (boolean(not object)) from another actor BP.
Answer found here