DontDestroyOnLoad ONLY First Object

I have a GameObject I want to keep between scenes and the whole

if (!exists)
        {
            exists = true;
            DontDestroyOnLoad(transform.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

thing works great, except when I re-enter a scene it deletes the old object and keeps the new object. I want it to keep the old one as it holds some information. Does anyone know how to achieve this?

Don’t use this construct. I know there’s like ten zillion tutorials out there advocating it but as you can see, it has ALL kinds of weird edge cases.

Instead, use this construct, and DO NOT put anything in the scene:

Simple Singleton (UnitySingleton):

Some super-simple Singleton examples to take and modify:

Simple Unity3D Singleton (no predefined data):

Unity3D Singleton with a Prefab (or a ScriptableObject) used for predefined data:

These are pure-code solutions, do not put anything into any scene, just access it via .Instance!

If it is a GameManager, when the game is over, make a function in that singleton that Destroys itself so the next time you access it you get a fresh one, something like:

public void DestroyThyself()
{
   Destroy(gameObject);
   Instance = null;    // because destroy doesn't happen until end of frame
}