Walking between scenes

i need help with walking between two scenes. I need to force my character to go from “town” scene to “swamps” scene. I Know ho to do that. What i actualy need is to make my character appear at the gate when he transfers from the “swamp” scene back to “town” and vice versa.

I know i should use a DontDestroyOnLoad. But i cant make it work. It just duplicates the player and i am ending up with more and more copies as i go throurh the scenes.

I need the dont destroyed player to apply as main player and somehow destroy the transfered one.

If someone could put here an easy script. I know its lot to ask but I am limited by deadline because this game is a school project.

And also please pardon my english its not my native language.

Thank you in advance.

you should use a singleton.
probably you have an instance of the player in the scene you are trying to load.
When a second player gets there from the previous scene, you get two copies of the player.
A singleton would avoid that behaviour.
Check tip #29 in the following :