I keep getting this error now in Game Maker:
FATAL ERROR in
action number 1
of Step Event0
for object base_enemy:
Variable base_enemy.hp(100013, -2147483648) not set before reading it.
at gml_Object_base_enemy_StepNormalEvent_1 (line 2) - if(hp <= 0){
I understand that it's not finding the variable hp
in the object base_enemy
during Step Event, but I'm not sure why. I think that the parenting I did has something to do with it, because it found hp
before further edits to the code. It's set up like this:
base_enemy
(top parent);
base_grunt
(first child);
obj_grunt
(second child)
The hp
variable is set in the Create Event of the second child of each unit. Is it possible that the Step Event is checking for hp
before the variable is declared?