How to pass a gameobject between scenes

I am trying to find a way to pass my player object between levels in my current project. I have read that I can use Object.Don’tDestroyOnLoad to keep all the player data the same when I pass the player between scenes but I don’t know how to pass the object itself. Would I have to instantiate the player into the next scene?

Never had to use it, but wouldn’t SceneManager.MoveGameObjectToScene() work?

A good way to do this is just to make a testing scene set up what you want to transfer to another scene in that scene and just turn it into a prefab.For example I made a character with a bunch of scripts and animations.I take it and frag it to my library and make new scene and pop him in the scene like nothing happened.

You do it like this:

private void Awake()
{

        var curObjectScripts = FindObjectsOfType<CurObjectScript>();
        if (curObjectScripts.Count() > 1)
        {
                Destroy(gameObject);
                return;
        }

        DontDestroyOnLoad(gameObject);

}

When you don’t destroy on load, this game object will live for all scenes. If an additional is created, it is destroyed immediately so that only one instance remains.