Im creating a practice game where a player goes into a cave and back out and I have sucessfully coded the player going in and spawning “inside the cave” and the player going back out the cave. However, I am not sure how to program the player to spawn at a certain location right next to the cave instead of its initial spawning location.
Correct. You could make an empty Node3D or 2D (depends on your game) and reference that node in your player spawn script. When you call the spawn method you will just instantiate the player and set your player’s GlobalPosition to this Node3D’s GlobalPosition.
Depends on how you’re loading in the level. If you’re adding the scene when you teleport into the cave you can use the _ready() function to move the character node to the Marker3D’s position.
Can you paste the part of the code that you’re using to switch between being inside and outside of the cave?