How do I make it so when the player jumps on an enemy it only destroys the enemy that they jumped on? Currently, I have multiple enemies spawning from an object and if one of them is jumped on they all are destroyed. Please help!
Link to CAPX:
Develop games in your browser. Powerful, performant & highly capable.
It's because you're picking the hurtbox and then destroying a hurtbox and enemy so the hurtbox is picked correctly as the one you jump on but then you are saying destroy all enemies. You can fix it by putting the hurtbox in a container with the enemy and remove the destroy enemy action. This will then destroy the hurtbox but also the enemy that is attached to it. Another way is to relate the hurtbox to the enemy with a variable ID and destroy the ones that match but a container should be easier.