Health Variable Not Changing
Posted: Thu Aug 25, 2011 2:42 am
I'm having a problem with my battle system. Basically, I have a collision event on the attack Actor that activates when it collides with the enemy. Here is the code, where "tech1" is the type of attack it is, and "p2hpbar" is the enemy's health points. "p1atk" and "p2def" are just stats which I know for a fact do not equal zero.
Now for some reason, p2hpbar doesn't change when the actor collides with the enemy. Any solutions or tips? This is key to my game.
- Code: Select all
if (tech1==1)
{
p2hpbar-(2*p1atk/p2def);
DestroyActor("Event Actor");
}
Now for some reason, p2hpbar doesn't change when the actor collides with the enemy. Any solutions or tips? This is key to my game.