• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

GMS 2 [SOLVED] Warp between rooms problem

Sqoler

Member
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:

Sqoler

Member
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
 
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