DontDestroyOnLoad Not Working At All

I have quite a few objects which I’d like to keep for the next three scenes (about 25 objects total). I made the script below, and attached it to all the objects. Unfortunately, the objects destroy when I test the game and make it to the next level. There are no script errors, and I can’t see anything wrong with the scene I’ve set up. Basically, the script does nothing and I’m not sure why. If anyone knows common problems with DontDestroyOnLoad, or anything else that might help, it would be much appreciated.

#pragma strict

function Start () {
		DontDestroyOnLoad (transform.gameObject);
	}

One other thing to check is that these objects are in the root of the hierarchy. If not their parent object may get destroyed which unfortunately means their demise too.

Put it in Awake.

If you put it in start, that object can be destroyed before start is called by actions in Awake/OnEnable

Put it in First line of Awake function it will solve. because it need to execute first,Put it in awake