I’m having a difficult time figuring this out.so I’m making a endless runner and in my tiles I’m spawning actors on the tile
0 to 3 of them and when spawned I add them to my ref array but when I call destroy actor it doesn’t work
Note
I’m using spawn actor from class to randomize the obstacle and the add component node is weird cause it spawns the off my tile whether I get relative or world transform.
show us your script so we can see what youve done. also the link there is because you didnt put a space between the . and so. since there is no space then it get read as a link.
I’m not a vet or anything, But I’d also create an array to tell you how many items have been created during each section. Because you have random amounts created you’d have to use guesswork to remove exactly what you need.
Having an Objects spawned array combined with the Obstacle ref array, you can use the objects spawned array to find out how many indexes to destroy&remove from obstacle ref array. For example you’d just run destroy actor and remove index 0 from obstacle ref array (objects spawned array amount of times).
You said you were having trouble destroying the actors though and none of those even cover that. How are you trying to destroy them?
Can you try adding a class array to your bp and test it (and make sure to close out the engine that where I get my error) my current class array has a rock and a tree in it for testing
Oh… That error isn’t anything to do with trying to destroy them.
Seems like you have an error in your array somehow with the wrong type of item making its way in there. Check to make sure they’re all blueprints.
You can do all that destroy actor in a lot less work by the way(and have it scale so you don’t have to keep ‘upgrading’ it)
I’m using a spawn actor from class with it attached to my class array and all of them are blueprints. The error is causing it not to add to the array and messing the code up. Some tiles get destroyed but the ones with obstacles don’t get destroyed. So I guess my problem is how to properly add them to my ref array.
i accidentally clicked validate and now I’m stuck waiting 50 years to try something.
I had an idea that maybe things created as anything other than actor might be causing this like creating as worldstatic/dynamic. But it’s probably going to be an hour or so before I can actually test.