GameMaster and Player Character - all scenes

Hey,

So I’ve got a PlayerCharacter and a “GameMaster” script (contains a handful of static components: pause screen, some HUD details etc. as well as the DoNotDestroyOnLoad function).

They both are in my ‘main’ scene (1) and I have an indoor area (scene 2) which you can go in to via a door (very basic setup). I am hitting a snag when coming back to scene 1 from scene 2.

I have set the return position and all, but the PlayerCharacter and GameMaster game objects get recreated as I re-enter scene 1. I can set GameMaster to instantiate my PlayerCharacter prefab on Start(), but when the GameMaster is recreated the instantiate fires again.

Thanks

u will create a static variable like that

static door:int;

start()
{

if(door==0)
{
instantiate(Here);
door++
}

}