I’m attempting to recreate my own version of Space Invaders, I have BP_Enemy as the actor with multiple meshes and collision boxes so I’m not dragging them all out one by one and they move at the same time, also hoping this is more performant.
The issue is with my current method of working out which mesh/hitbox is no longer valid/destroyed and if ALL of them are invalid a widget should show up which isn’t triggering properly as I’m not sure what is the best solution for this is or even a working solution.
This is the logic in the BP_Enemy Event Graph / how I’m attempting to make sure all enemies are destroyed before showing the widget via ‘Game Win’ but it wants me to destroy them in order otherwise it doesn’t work.
I’m pretty sure you’d be better off if you had them as single actors. Collision overlapped, destroy, that’s it. Otherwise, you spend most of your time figuring out which one is which.
You can use a blueprint to place them procedurally if you find doing it by hand a hassle
Are they walking up and down, like the original game?
that does sound like a nicer way to do it, I’ve never touched the procedural side of things, I guess no better time than now, yes they are doing the walk down after hitting a wall then walking to other side, moving down then moving to other side again
So we get that oscillating, forth & back swing. You can, ofc, have many timelines. Load them dynamically, too. Or have a vector track instead of a float - 3x as much data.
Another way to handle this more gracefully, is to count the enemies as you add instances:
Note that the Hit should be detected in the Projectile BP. If you try it in the actor owning the instances or override instances’ events themselves, it may just crash - there is not enough data in the Hit - namely, the Hit Item is not generated - that’s afair.
Yes. And you’ll need to set up collision channels properly, too, ofc. Open the asset (the invader spaceship), remove collision first, and add a box or a more complex DOP:
And channels can be set up in a granular way (this is just an example, you’ll need your own). For now, you can set it to block all for the projectiles (which we do not how you handle yet) and the ship:
Because we now have actual collision… and the projectile probably collides with what fires it. That’s why collision settings offer granular controls. If you fire it from the Pawn, have the Pawn Ignore the projectile. The Pawn is shooting itself in the foot, most likely.
If in doubt, check what the projectile collided with.
It’s almost 100% what I mentioned above. The projectile collides with the Pawn that fires it. Have it Ignore the Pawn. Please check out the link I posted above. It might as simple as:
That’s be the setting of the projectile’s root collider.
Or spawn the projectile away from the firing Pawn.
I put everything on ignore projectile and ignore pawn and it still didn’t move, only adding an arrow and moving away from the character did it work sooo odd, the enemy still doesn’t get destroyed maybe thats collision related to
should this be overlap the player_shoot the projectile itself to destroy enemy then? or is there a better way