S
Solvir
Guest
Hopefully someone can help me with this..
When my character attacks it calls upon this function to create an obj in the room:
Now this works within rm_1. When I get into the next room, I can move around just fine, but when I attack the game crashes and gives me this:
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_player:
Pop :: Execution Error - Variable references invalid object (-4).<unknown variable>
at gml_Script_scr_attack_state (line 55) - damage.creator = id;
############################################################################################
My first guess is the instance_create_layer() isn't assigning the proper layer ID. So my question is, how do I get my layer ID to work for multiple rooms? Or is there something else I need to do? Pretty stuck and very new to gamemaker so please be patient with me, thank you!
When my character attacks it calls upon this function to create an obj in the room:
Code:
var damage = instance_create_layer(xx, yy, rm_1, obj_damage);
damage.creator = id;
damage.damage = obj_player_stats.attack;
attacked = true;
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_player:
Pop :: Execution Error - Variable references invalid object (-4).<unknown variable>
at gml_Script_scr_attack_state (line 55) - damage.creator = id;
############################################################################################
My first guess is the instance_create_layer() isn't assigning the proper layer ID. So my question is, how do I get my layer ID to work for multiple rooms? Or is there something else I need to do? Pretty stuck and very new to gamemaker so please be patient with me, thank you!
Last edited by a moderator: