Your problem is here:
mindcontrol wrote:On enemy collision with shoot -> enemy.hp=enemy.hp-2;
Writing enemy.hp targets the enemy with the cloneindex 0.
What you should do is just this:
This will take away 2 hp from the actor that is executing the code, so it would damage the enemy that has collided with the bullet actor you're calling with the name "shoot".
![Smile :)](http://game-editor.com/forum/images/smilies/icon_smile.gif)
- Code: Select all
hp=hp-2;
EDIT:
Also, you'd better move the other code together with the damage code. It's always better to try to avoid putting codes in Draw Actor, as those get executed every frame when the actor exists, and most things are not needed to be executed so often. So, ideally, you'd have this in you "enemy" collision with "shoot":
- Code: Select all
hp = hp - 2;
if (hp <= 0)
{
DestroyActor("Event Actor");
}