Multiple Enemies Attack Player

Hey guys, how do I make not just one type of enemy attack my player? I have the attacks, but when any other type of enemy attacks my player, they don’t do damage. The enemies I want to attack my player are the Elite Draum and Giant Draum. Is there any way to do this?


HighPower Game

1 Like

You have to make the same connections for all enemies.
OR you can make a new object called “enemy parent” and set it as the the parent of all the enemy objects. Then you just need a collision for the “enemy parent” object in the player.

2 Likes

Should I use a global object in logic to make it the enemy parent in my player’s behavior?

No, having behaviors in the parent will make it use that code in the background of the child objects. If you just want to just have shared collision, you just need to set the parents of the enemy objects.

1 Like

How do I make an object that acts like a parent? Do I just use any of my enemies and set them as the parent, or do I have to make a whole new object? How should I proceed from there?

  1. Make a new object “enemy parent”
  2. Set the parent of all your enemies to “enemy parent”
  3. Set the collision in the player to “enemy parent”

It worked. However, the enemies now have the same HP when the player attacks them. The player does 50 damage to each Draum. The normal Draum(parent) HP is 500. But my Elite Draum’s HP is 2000, and the Giant Draum’s is 20,000 HP.

Looking at the game, you did not make a new object called “enemy parent”.
You set all the enemies to the first enemy as the parent, so they are all using the first enemies code too. That is why they all have the same HP. You need to make a new object with no code.

2 Likes