- Home /
 
Respawn Method not reusable between scenes ?
Hey there !
Okay so I searched the forum for this problem but didn't find my answer. I have a very simple method here :
 public void Respawn() {
         GameObject respawn = GameObject.Find ("Respawn");
         Transform respawnPos = respawn.GetComponent<Transform> ();
         rb2d.position = respawnPos.position;
     }
 
               rb2d is my rigidbody's component. I want to use this on different level by keeping it in a "DontDestroyOnLoad" object. I have a different gameObject "Respawn" in each level, but the method keep the first position like "in memory" and never change this location. A little bit of help ?
Many thanks ! :)
               Comment
              
 
               
              Your answer