How to? Link scenes say by walking sprite through a door

Forgive me, I am very very new, I get the basic basic stuff in the platformer tutorial and i have succeeded in making a little pixely top down area with a building and a movable sprite like old rpgs. i want to make the doorway to the door link to a new scene (the inside of the building)when i move my sprite into it. How do i do this? Any tutorials you could point me towards as I’m not finding anything in this direction. Thank you so much! :smiley:

You can mimic the classic RPG builder style adding an invisible object to trigger this event. For example:

  1. Create a new sprite object “Teleport”, with the dimensions of a tile or a reasonable size.
  2. Add an object variable to this sprite, named “Destiny”, with an empty value for now.
  3. Drag this Teleport object to the scene, where you want the teleporting event to happen, for example under the door.
  4. Modify this Teleport instance, set the “Destiny” variable = name of the scene it should load.
  5. Add the event:

Conditions: Player is in collision with Teleport Actions: Pause this scene and go to the scene Teleport.VariableString(Destiny)

  1. For debug this is ok, but for release remember to hide all the Teleport objects at the beginning of each scene.

The good think about this method is that, while editing and debugging, the Teleport object will be a graphical event easy to move and edit, I recommend to set the sprite image translucid, it looks a lot better this way, as other RPG maker editors do :slight_smile:

Note that you can use this system (sprite object to trigger events) not just for teleport, but for anything that needs to be triggered at certain locations/areas :wink:

Thank you that’s very helpful! Unfortunately I can’t get it to work :frowning:

I don’t know if it’s because I’m using the mac version which is still in beta, but I’m unable to change object names, when I go to properties the “object name” row is grayed out and clicking on it doesn’t do anything.

While I’m here, the object that I’m inserting, it’s just a sprite yes, same as you would insert for your character?

And the event added part, I would do that by inserting javascript code, and copy everything you typed, including code: select all? as in:

“Code: Select all
Conditions: Player is in collision with Teleport
Actions: Pause this scene and go to the scene Teleport.VariableString(Destiny)”

put all that in?

Finally, when modifying the teleport instance, does that mean entering the initial value of the destiny variable as “New Scene 2” (which i want to teleport to? Or am i missing something entirely?

Thank you so much if you get to answering this, like I said I am a beeeeginner, I don’t know anything. I just want to recreate my childhood lol.

You are a little lost hehe, don’t worry, it’s always difficult at the beginning :slight_smile:

The “Properties” window can’t modify the object name, just tell you that the selected object is an instance of X (even for the main object).
To modify an object name, do a right click over the main object (the one at the right window “Object’s editor”), then select “Rename”, in Windows the F2 key can be use too, after selecting the object:

Yes, a common sprite, the only difference are the events pointing to the player or the teleporter.

Oh no, it’s just a way to write GD events (the nice non programming ones), the event I wrote would look like:

You are not missing anything, this is OK. The Teleporter object has a variable to remember where to teleport the player, it is just a text, a string, but then you’ll use this value in the event to change the scene through the function “Teleporter.VariableString(Destiny)”, that return this variable (see event image above).
So you are telling to GD: "When Player collides with a Teleporter, go to the scene named ‘value stored in the Destiny variable of the Teleporter’ "

Finally, nothing better than an example: (61.2 KB)
Just some things to note:

  • You have to compile the project to test the scene switching on native, it’ll work OK for web I think.
  • In the event that switches the scene when colliding a Teleporter, you’ll see a “Trigger once” condition, this condition is needed so you’ll be teleported only one time for each collision, try deleting the “Trigger once”, compile and see what happens. A better and classic approach could be moving the Player when return to the town map so it doesn’t collide the Teleporter anymore.
  • The images where downloaded from, specifically: and

Success! Thank you you are awesome!