Warp to a location within same room

I see a lot of tutorials about warping to other rooms, but what if you want to warp to a different spot in the same room? How would you go about that? The simple code I'm familiar with is:

if room=room1{
room_goto(room1)
x=1315
y=107
}

As you can see, I am trying to warp to different x/y coordinates within the room. How is that done? I'm new to programming and GML btw, so be kind, please.
 

TsukaYuriko

☄️
Forum Staff
Moderator
Remove the room_goto part and you will merely change the coordinates of the calling instance... which is a different way of saying "warp to a different location in the same room". ;)
 

TsukaYuriko

☄️
Forum Staff
Moderator
For future reference, your PC will not explode (maybe) if you try out code regardless of whether you know if it's correct or not. Sometimes, you'll find that you had the right idea and that it works exactly the way you'd want it to. Don't be afraid to just try out things - that's how you learn. ;)
 
Top