Functioning doors betwen scenes

Godot Version

4.3

Question

Hey, im still pretty new to programing in general and i can't realy figure out how to get the positions right when walking through a door to a new scene, i feel like just setting the player position to outside the door adds a bunch of unnecessary lines of code and i feel like there's an easier way. thanks!

You might consider giving each door in your game a Node2D or Node3D (depending on whether you’re doing a 2D or 3D game…). Leave the node empty, but put it where the player should appear if they come in through that door. Then, when you enter a scene, you can set the player’s global_position to the global_position of the position node.

My question would be, what are you doing that the player needs to be positioned? Do you mean that when you walk across a threshold the ground isn’t in the right position on the next scene so that you have to jump because of a collision is too high or low, or are you doing something like walking through a door loads a new world?

I read your post and wasn’t quite sure if your problem is that you’re making life harder on yourself.

For example, in my world which is its own scene, I have lots of buildings which are separate scenes, but the world is largely agnostic to these as they always spawn in the correct vectors such that my player can enter/exit fine without having to jump or be positioned. The only time I have to position my player is upon exiting/entering a vehicle, or loading a game or something way more complex than entering/exiting a structure.

Forgive me if you’re doing something more complex and I’m not really sure if you’re doing 2d or 3d.