Hi,to make script like ethis its pretty easy,but i want to know wich is the best way to make script like this : Well,when i get into trigger i die : Destroy (Player); and next action is Application.LoadLevel (Application.loadedLevel); <------ it loads the same level and i spawn in default position. All i want is : when i enter in the trigger and when level reloads,i spawn in different position,not in default,but in different (my chosen) position. Any help?
Title edit : Need help. I want to spawn in different position after level reload!
Does the player have don’t destroy on load in the script?
You could have some preset positions put into an array and have the script choose a random number up to the maximum index of the array to choose a random preset spawn point.
I dont have script yet,all i want is after player destroy and level reload,i spawn in my chosen position,im looking for script example,cause i dont understand the way it need to work.
on player:
void Start ()
postiion = Vector3(Random.values)
or if you want to set a bunch of spawnpoints and choose at random, create GOs in position, add them to an array and:
void start ()
position = spawnTransforms[random.Range(0, count)]