health minus attack
Posted: Wed Jun 20, 2007 10:34 pm
I want an actor's health on a collision to equal enemyhealth-shotattack
here is my code:
__________________________
on collision
enemy1health=enemy1health-shotattack
_________________________________
where enemy1health and shotattack are integer actor variables
For some reason whenever I insert this code, no matter how many times I hit the enemy, it doesn't die. I have enemy1health set to 5 and shotattack set to 1. And yes, i have an event for ---if (enemy1health == 0) destroyactor enemy1[/code]
here is my code:
__________________________
on collision
enemy1health=enemy1health-shotattack
_________________________________
where enemy1health and shotattack are integer actor variables
For some reason whenever I insert this code, no matter how many times I hit the enemy, it doesn't die. I have enemy1health set to 5 and shotattack set to 1. And yes, i have an event for ---if (enemy1health == 0) destroyactor enemy1[/code]