Switching between scenes create a lots scenes.

Hi guys! Im noob here.
Im trying my game and my problem is when I try to switch between scenes, my script create 4 stances of the new scene, its so weird, I will post my code and some screenshot:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class StairsTeleport : MonoBehaviour
{
    GameObject player;
    void Update()
    {
            if (player != null)
            {
                StartCoroutine(LoadYourAsyncScene());
            }
    }
    void OnTriggerEnter2D(Collider2D col)
    {
        if (col.gameObject.CompareTag("Player"))
        {
            player = col.gameObject;
        }
       
    }
    IEnumerator LoadYourAsyncScene()
    {
        // Set the current Scene to be able to unload it later
        Scene currentScene = SceneManager.GetActiveScene();

        // The Application loads the Scene in the background at the same time as the current Scene.
        AsyncOperation asyncLoad = SceneManager.LoadSceneAsync("VOID", LoadSceneMode.Additive);

        // Wait until the last operation fully loads to return anything
        while (!asyncLoad.isDone)
        {
            yield return null;
        }

        // Move the GameObject (you attach this in the Inspector) to the newly loaded Scene
        SceneManager.MoveGameObjectToScene(player, SceneManager.GetSceneByName("VOID"));
        // Unload the previous Scene
        SceneManager.UnloadSceneAsync(currentScene);
    }
}

I get this code from unity Unity - Scripting API: SceneManagement.SceneManager.MoveGameObjectToScene

The image with the 4 stances:

Your if statement in Update() is likely starting multiple coroutines. Put a Debug.Log() just before line 13 and see how many times the message fires. If it’s more than once, you’ll need to make sure your StartCoroutine can only run once. Probably with a bool flag ‘loadingScene’ or something to that effect.

This is almost certainly it. I think if you just put player = null; around line 13 it would do what you want because it will “consume” the trigger event essentially, and only consume it once.

Yes, that’s is a better solution than messing with an unncessary bool.

Well, thinking more on it, your bool might be better if somehow the player was able to ram the collider twice before the above script unloads…