Make player spawn at point when loading a scene.
In my game I'm making, I have a top down perspective. Its RPG style and when I have the player enter a building, it loads a new scene and starts the player at the door inside the house. Awesome. The trouble I'm having is when you exit that building, it spawns the player at the beginning point of that scene, not outside the building entered. I've seen tutorials about transform positions, and using don't destroy on load and even someone suggested using prefabs and teleporters I am new at using the Unity scripting references. I am just having a hard time with this, and its discouraging. Because of changes in Unity 5, many of the scripts don't function properly. Can someone help me understand how to write a script for this? I mainly use Javascript
if(coll.gameObject.tag == "ExitDoorMom")
var player = GameObject("ExitDoorMom");
Application.LoadLevel(0);
This script (even though unity says its obsolete in 5) works for me. It allows me to load the scene. What can I add to it to load a new scene, and once the scene is loaded, move the player to a specific position.
I'm not trying to have all the work done for me, I'm trying to learn. Any help would be much appreciated! Thanks again!
The easiest solution in my $$anonymous$$d is :-
You dont need to use don't destroy on load . Do destroy the player with previous scene. And when the next scene loads then the player should be present the position which is required by you..
No??? Is this okay for you?
this will not work if you have some other requirements. Then we have to think something else
Your answer
