how do i make it so i load into the scene and at a GameObject. In the script i only load to scene but i want to be able to load in to different areas in the scene from other scenes.
#pragma strict
var NewScene : String;
function OnTriggerEnter(Col : Collider)
{
if(Col.tag ==("Player"))
{
Application.LoadLevel("DarkTown");
}
}
Hi ;
I think u can do that with PlayerPrefs;
for example if u have 3 doors in the first Scene change the name of the doors to “0” , “1” , “2”;
then before u load the next set the name of the door as an int to prefs like this :
PlayerPrefs.SetInt("door entered ", int.Parse(door.gameObject.name));
then when u go to next scene create a manager that in the Start() method get this pref and based on the number change your position in a special area :
switch (PlayerPrefs.GetInt("door entered "))
{
case 0:
player.transform.position = new Vector3(1, 1, 1);
break;
case 1
player.transform.position = new Vector3(2, 2, 2);
break;
case 2
player.transform.position = new Vector3(3, 3, 3);
break;
}