The array contains actors; The actors are all from the same (blueprint) class. It’s just a few in the scene.
The blueprint class is called Blueprint_CellWall. The array is set to be editable, and exposed on spawn, so I set its contents from withing the editor window. Here’s another pic from the editor:
The best way to troubleshoot your issue would be to use “Breakpoints” to find what part of the code is firing and what isn’t. What I would do is attach a “Print String” to the “Is Not Valid” to see if that’s being fired.
I also notice that your “DoOnce” isn’t resetting, so it’s literally only ever firing once, But I haven’t had much experience with the “DoOnce” node.
I reproduced your error. Gotta be honest, I’m not 100% sure why it wasn’t deleting, but I tried a different approach and got it to work.
First, forLoops keep shooting even if the first iteration hit a delay or timeline, so you probably don’t want that. Because a timeline can be used like a tick event that you can turn on and off, just keep checking the length of your array to see if it is 0. If it is, stop the looping timeline. (I put a delay on mine, I don’t know if you wanted a pause in between each one or not)
The code below does what you seem to be trying to do. I don’t know all of your code. The code I provided shows how to delete multiple actors using a timeline.The order in which they are deleted would be decided by the order you add the actors to the array.
Any changes are of course up to you. I’ve commented the differences I have made.
Haha, thanks so much!
You’re really helping me out! Do you know what I could do if instead of destroying the actor, I wanted to add actor world offset (where the delta value is driven by the timeline?)
Something like this maybe, but that actually works?
This would do it one at a time, however, and doesn’t use the timeline value (that didn’t work for me). If you want to do it all at once you could make a function attached to the timeline that does all of that for each one. basically copy most of it, make a function out of it, and the inputs would be the actor from each index of the array.
If this answers your question, mark it as accepted after you try it out c;
Thanks for all your help,
It doesn’t seem to be moving :
When the code runs the items in the array wont’t move and so the if statement checking if the actor location is equal to the moveToLocation never becomes true.
EDIT: Forgot to mention, if you set the target for the move actor node to the self (AKA the blueprint that’s running with, it does work, and moves itself)