I’m not really sure what the video is supposed to show, but you can simply add some colliders a little over the edges that kill anything it touches.
The gameplay does look fast, so you might want to look into a pooling system instead of destroying them outright- pooling systems basically reduce the number of times actors are created and destroyed.
Collision box on the left side, spaced far enough left that left entering actors do not collide. Shape it to vertical rectangle. Top to bottom of screen space, but only about 100cm wide.
On End Overlap → Actor → return to pool.
Spawning and destroying are performance hits. Especially at high frequencies.
Hey, you two, so the only issue I have is how the pooling will work with the sequencer.
Everything (except projectiles) is choreographed; not procedural or random.
I could potentially pool projectiles… but I feel like pooling enemies can get messy.
I’m brainstorming… but it seems that trying to pool could cause bugs with the sequence.
If it’s a sequence, you can just implement the pooling system yourself. Instead of creating a new actor, you can move the out of frame ones and use them.
So useful to get other perspectives. I better understand how to effectively use the pooling technique with the sequencer.
For any future programmers:
Set up the entire choreographed on-rail sequence in the sequencer, taking care to limit the amount of actors you use. (A good practice would be to sketch the level by hand BEFORE coding anything)
Anytime an actor/enemy is defeated, using an Overlap function (Begin or End, depending on your needs; for me, it’s Begin), set visibility to HIDDEN and disable COLLISIONS and any attack logic you coded.
If an enemy is not defeated, and falls out of view of the passing camera, set a geometric collision (usually box) that spans the height and depth of the level, just out of camera view that moves with the camera. This geometry will act like the player’s projectile and “KILL” the actor.
MOVE deactivated, hidden enemies further along the level to be used again in the sequencer, reactivating logic, visibility, and collisions.