Hey, so I’m currently working on my first endless tracking shot for a music video, using what I learned in the official endless runner tutorial. But somehow my actor count keeps creeping up by the amount of actors+children actors.
you only destroy the last actor of the array because you connect the destroy actor in “completed”, you need to connect the destroy actor to the “Loop body”
Hey, thank you, I implemented these changes, but the actors still keep piling up.
It has no effect on the performance even with 2k actors, but I’d rather keep the scene tidy.
I’m completely at my wits end. My scene recently started slowing down as soon as I hit the 1000 actors mark and I still can’t figure out why the actors keep piling up and aren’t destroyed.
Currently working on an endless tunnel, so I’m basically destroying the [0] in an array of nine tunnel pieces after the camera has passed it, and adding a new one at the end.
Already checked for the cast failing, that is not the case, will check for spam of overlap events next, thanks!
You made me realize a mistake I made, I thought they were being destroyed, because they were disappearing from the outliner, but just now i double checked and expanded the outliner.
Currently working on an endless tunnel, so I’m basically destroying the [0] in an array of nine tunnel pieces after the camera has passed it, and adding a new one at the end.
Well, I see that your camera actor is capable of overlap. Are the actors you want to delete also able to overlap? You could just have them call destroy on themselves on Actor End Overlap.
If I understand correctly, it is just a camera going forward, so you are just deleting the tiles after it passes them right?
Your destroy is tied to “completed” pin rather than the loop output. Posters above already told you about this, so I’m assuming you changed it.
You are using a for each loop rather than a reverse for each loop. If you want to destroy an actor, you usually have to use the reverse for each loop rather than the regular one. This is because deleting actors in an array screws up regular for each loop.