• 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!

GameMaker [SOLVED] Warp between rooms problem

S

Sqoler

Guest
Hi.

I am new to GMS2, and while trying to add a warp to my game, it does not work. When I go into the warp object I made, I do teleport to the second room with my character, but I teleport under the other object I have. Take my grass for example. The grass layer is above the player layer. Any way to fix this?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Is the player object persistent? If so then this is partly because of a bug (which will be fixed in the next update), but the fix is really easy... Simply add a "Room Start" event with code to assign the instance of the player object to the correct layer, like this:

Code:
/// ROOM START EVENT
layer = layer_get_id("Main_Instances"); // Use the name of the layer you want to assign the instance to
:)
 
Last edited:
S

Sqoler

Guest
Is the player object persistent? If so then this is partly because of a bug (which will be fixed in the next update), but the fix is really easy... Simply add a "Room Start" event with code to assign the instance of the player object to the correct layer, like this:

Code:
ROOM START EVENT
layer = layer_get:_id("Main_Instances"); // Use the name of the layer you want to assign the instance to
:)
It gives me this error when I add that code:
Object: objplayer Event: Room Start at line 5 : unknown function or script _id
 
H

HoboJoeFish

Guest
Hey, I had the exact same issue. I tried using the code that was linked but I don't know where to put it. Also how do I know what the name of the layer I want to put it on it called. I just started learning how to code so I'm pretty lost here.
 
Top