Here are screenshots of the entire thing:
Player state 1:
http://imageshack.us/f/39/player1c.png/(gets the owner of the FSM and puts it in a GA variable) (this is used for the zombie to track and move towards the player)
Player state 2:
http://imageshack.us/f/37/player2c.png/(goes to listener and waits for health to be = or below 0, where after it should move to state 3 and destroy the player)
Player state 3:
http://imageshack.us/f/819/player3t.png/Health Manager state 1:
http://imageshack.us/f/255/healthmanager1.png/Sets the player's start health of 100 and saves itself in a GA variable (for the zombie to send the damage event when it hits the player)
Health Manager state 2:
http://imageshack.us/f/35/hm2yc.png/Converts current health to a string and displays on the HUD
Health Manager state 3:
http://imageshack.us/f/823/healthmanager3.png/Waits for the zombie to send the retract health transition
Health Manager state 4:
http://imageshack.us/f/11/healthmanager4.png/makes a -25 change to the health int and goes back to state 2 where it updates and displays the new health value, then goes back to listener again
Zombie state 1:
http://imageshack.us/f/542/enemy1.png/the zombie has a trigger around it, so when it reaches the enemy it goes to stage 2. In this stage there is also a tween, making the zombie move slowly towards the player
Zombie state 2:
http://imageshack.us/f/100/enemy2.png/Send event to the Health_Manager to make a -25 change to the player's health int
Zombie state 3:
http://imageshack.us/f/9/enemy3.png/Wait 1.5 secs before you start chasing the target again (this also prevents zombie from doing damage more than once every 1.5 seconds) this is a temporary solution and will be replaced with a zombie hit animation instead
__________________________________________________________________________________________
No i'm not checking every frame, and the health int works fine in itself starting with 100 hp and retracting 25 every time the zombie hits - the problem is in the player state 2 where it compares the int with 0 and it doesnt work even though i can see the int changing to 0 the compare doesn't register it.
It works if i make the compare be 75 and the comparison being above (it will register the hp is 100 which is above 75 and will then successfully destroy the player) but it wont register "equals to" or "below" =(
Any help is greatly appriciated