Player Positioning Based on Previous Scene

My character is moving through different rooms, but when they go through doors and I load the scenes the player always goes to the position set in the editor. Is there a way to set the position of the character as the scene is loaded? Here is my script so far:

     public string sceneToLoad;
     public Vector2 playerPosition;
     public VectorValue playerStorage;
 
     public void OnTriggerEnter2D(Collider2D other) {
         if (other.CompareTag("Player") && !other.isTrigger)
         {
             SceneManager.LoadScene(sceneToLoad);
         }
     }

Thanks!

Two ways:

  1. Add a SceneManager.sceneLoaded event handler, Unity - Scripting API: SceneManagement.SceneManager.sceneLoaded
  2. put a initialization script in the new scene that sets the player position in it’s Start() which gets called automatically when the scene with that object is loaded.