• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

not changing rooms?

C

corwin22

Guest
I have a code that uses a variable to determine what room it will take you to but it just puts you back in the same room?
Code:
rm = "rm_door" + string(symbol)
if ((place_meeting(x,y+64,obj_player)) && keyboard_check(vk_space)) {
room_goto(rm)   
}
the room's name is rm_door1 and symbol = 1
when i draw "rm" is shows "rm_door1" so i am confused why it doesn't move me to the right room.
 

Humayun

Member
room_goto() function requires room index not its name in string. Take a look asset_get_index() function if you don't want to change your code. So finally you'll have something like
Code:
room_goto(asset_get_index(rm))
 
Top