C
chessmates
Guest
hi, im fairly new to game maker studio, and im having trouble with my healthbar. i coded it myself, but i cant get it to work, when i try to run the game i get an error upon running.
this is the error message:
ERROR!!! :: ############################################################################################
FATAL ERROR in
action number 1
of Create Event
for object obj_hpbarcorridor:
DoAdd :: Execution Error
at gml_Object_obj_hpbarcorridor_Create_0 (line 2) - sprite_index = asset_get_index("spr_hpbar" + state);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_hpbarcorridor_Create_0 (line 2)
and this is the code it says is wrong, both the step and create event:
step:
state = global.hp;
sprite_index = asset_get_index("spr_hpbar" + state);
create:
state = global.hp;
sprite_index = asset_get_index("spr_hpbar" + state);
this is the error message:
ERROR!!! :: ############################################################################################
FATAL ERROR in
action number 1
of Create Event
for object obj_hpbarcorridor:
DoAdd :: Execution Error
at gml_Object_obj_hpbarcorridor_Create_0 (line 2) - sprite_index = asset_get_index("spr_hpbar" + state);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_hpbarcorridor_Create_0 (line 2)
and this is the code it says is wrong, both the step and create event:
step:
state = global.hp;
sprite_index = asset_get_index("spr_hpbar" + state);
create:
state = global.hp;
sprite_index = asset_get_index("spr_hpbar" + state);