GameMaker Room Warp Error

ArudanIsMe

Member
So I tried to follow two youtube tutorials and when i test it, I get this error.



___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_warp:

room_goto argument 1 incorrect type (string) expecting a Number (YYGI32)
at gml_Object_obj_warp_Step_0 (line 4) - room_goto(targetRoom);
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_warp_Step_0 (line 4)


my creation code for the warp obj is this:

/// initialize variables
targetRoom = "none";
targetX = 0;
targetY = 0;

the step event is this:

/// update warp
if(place_meeting(x, y, objNigel))
{
room_goto(targetRoom);
objNigel.x = targetX;
objNigel.y = targetY;
}

and my creation code for the block that having issues is this:
targetRoom = Hallway_1;
targetX = 480;
targetY = 128;


Im trying to figure out what im doing wrong. I would be thankful for whoever can tell me what I need to fix
 

Greenwitch

Member
Code:
room_goto argument 1 incorrect type (string) expecting a Number (YYGI32)
It's honestly self-explanatory enough.

You're trying to execute room_goto(targetRoom) where targetRoom = "none"
 

ArudanIsMe

Member
Code:
room_goto argument 1 incorrect type (string) expecting a Number (YYGI32)
It's honestly self-explanatory enough.

You're trying to execute room_goto(targetRoom) where targetRoom = "none"
Yeah I figured it out. One of my objects were invalid so I had to redo it and its fixed now. Thanks
 
Top