DontDestroyOnLoad Getting duplicated

I have got a Gameobject with a script as shows on it.

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

public class GameDataCarrier:MonoBehaviour{

publicGameDatagameData;
voidAwake(){
DontDestroyOnLoad(gameObject);
}
}

When i load the game scene the Gameobject is fine it dose not get destroyed, but when i go back to the main menu level this gameObject gets duplicated and now there is 2 and each time it makes 1 more.

It didn’t do this before this version went out.

Can you help ?

Hi markpollard1,
Looks like you are trying to create a singleton. Here’s a tutorial on how to do that in Unity:

What is strange however, is your report, that it worked the way it was intended in a different version of Unity without enforcing the singleton pattern. Could you please file a bug report with the project attached to it and reply in here with the case #?