DontDestroyOnLoad related question

Hello everybody.

I have two scenes: in the first one, i have a clickable object that takes you to the second scene. In the 2nd scene, i have a button that returns the player to the first scene.

I have created a javascript with DontDestroyOnLoad and attached it to my player character object (named "Player") like that.

When i switch from the 2nd scene back to the 1st, the player appears below my terrain and starts falling to infinity. H

ow could i solve this? Thanks!!

You could try to set the position of your player as soon as the scene loads.

Hmm, you could try to do it with

Function start () {
 transform.Find("YourPlayer").position.x = 000.0;
 transform.Find("YourPlayer").position.y = 000.0;
 transform.Find("YourPlayer").position.z = 000.0;

Or to make it easier

Function start () {
 var player : Transform = transform.Find("YourPlayer").position;
 player.x = 000.0;
 player.y = 000.0;
 player.z = 000.0;

Something like that. Put it in a script that runs on the new scene.