EpicMcDude
Member
So this camera makes the game crash whenever the player dies or moves to another room, this is because the player object no longer exists so the camera crashes.
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event2
for object obj_Camera:
Unable to find any instance for object index '0' name 'obj_player'
at gml_Object_obj_Camera_Step_2 (line 16) - var targetX = obj_player.x - RES_W/2;
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_Camera_Step_2 (line 16)
Basically, if the player instance is destroyed, how can I make the camera stay on the player? I have no idea how to code this, especially with the room transitions.
Thank you in advance.
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event2
for object obj_Camera:
Unable to find any instance for object index '0' name 'obj_player'
at gml_Object_obj_Camera_Step_2 (line 16) - var targetX = obj_player.x - RES_W/2;
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_Camera_Step_2 (line 16)
Basically, if the player instance is destroyed, how can I make the camera stay on the player? I have no idea how to code this, especially with the room transitions.
Thank you in advance.
Last edited: