FeetUpGaming
Member
Okay so this code was working fine before. I have an object that set's it prevous hp to it's hp on the end step event then check it on the step event for change, if there is change it checks if it's below 0 then destroys it. However this doesn't work anymore i havn't edited the code it has just stopped working:
End Step event:
Step Event:
This was being done by a parent object but i do have the call inherited event on there
So i moved it into the object but still doesn't work
I returned its hp variable and it is in fact going down as it should be but the code which was working fine no longer works. (The only thing i can remember doing is moving it's parent event into a group)
From what i can tell the code has just decided to stop working.
EDIT: The step event is working but for some reason the prev_hp isn't being set properly (This has been working fine for 6 days until now.)
End Step event:
Code:
prev_hp = hp;
Code:
if prev_hp > hp
{
if player.can_hit = true
{
create_particle(x,y,3,3,pcol1,irandom_range(2,4));
create_particle(x,y,3,3,pcol2,irandom_range(2,4));
play_rand_sound(snd_hit,10,0.1);
}
if hp <= 0
{
instance_destroy();
}
}
So i moved it into the object but still doesn't work
I returned its hp variable and it is in fact going down as it should be but the code which was working fine no longer works. (The only thing i can remember doing is moving it's parent event into a group)
From what i can tell the code has just decided to stop working.
EDIT: The step event is working but for some reason the prev_hp isn't being set properly (This has been working fine for 6 days until now.)
Last edited: