Replacing objects in a new scene???

Hello,
I was wondering if Unity has a feature where IF an object has a ‘DontDestroyOnLoad()’ constraint on it and a new scene loads, and the new scene has an object of the same name or same tag, the object from the other scene ‘replaces’ the object from the new scene, but keeps the position, rotation and scaling of the object that gets replaced. Wouldn’t that be a great feature? Maybe have a function called ReplaceOnLoad() for that.

This would be useful if a programmer wanted to just test out an ‘empty main scene’ (where he writes all his code for the AI of all the characters in his game), places the scripts on the characters and then wishes to model other scenes (that will load right after the main scene runs during the game) of different virtual places containing different walls and different Navmesh areas. The programmer could then place his player (named “player”) anywhere in these different scenes and, when these scenes load up from the “main empty scene” that only contain the characters with the ‘DontDestroyOnLoad()’ constraint attached to them, the player could then automatically be placed anywhere in the scene of wherever the object “player” exists (as it gets replaced with the “player” object from the old (main) scene). What do you think of this idea?

What about having an object called something like “PlayerSpawnPoint”, which you place in each scene in a specific position/rotation. Then that object has a “Start” or “Awake” function that sets your player object (the one that does not get destroyed) transform to itself.

This means that every time you go to a new scene, your player will be set to the spawn point. Or am I missing what you are wanting to do?

What if I wanted to have an object called “Player” in my ‘main scene’, which the main scene is ONLY used for switching to a, ‘Game scene’ on load after determining what objects I don’t want destroyed on load, or for testing out my AI scripts on not only my player, but also my other characters in the game as well (with no walls and just a single floor in the main scene), then I have a different scene called, “Inventory” in a separate folder called, “Inventory” in which THAT scene is ONLY used to test out my GUI and scripts for the inventory of my game (in which I will eventually combine all my scripts in one big folder in one big scene, which would be my final product once I am finished testing everything and am satisfied with all my results). Then, I have scenes in another folder called, “Game scenes” where I put a separate player in each scene that does not use any of my AI scripts that my characters and player in my ‘main scene’ uses, but I can still walk around in my different, “Game scenes” because it has a ‘FirstPersonController’ script in it, and I just want to use those scenes to see how my game would look like when I walk around in the game as soon as I finally finish everything that I am scripting.

I want my game to first start off at the main scene (with my player and characters that uses BOTH my AI scripts AND the FirstPersonControllers in them). I don’t want the players and the characters to, ‘destroy on load’ and then I want my ‘game scene’ to immediately load right afterwards but the problem with THAT happening is that I would then have 2 game objects in the loaded scenes called, “Player” (one copy with just the FirstPersonController script, and the other with BOTH the FirstPersonController script, AND my AI scripts attached, in which THAT COPY, I want to use) AND, I would have 2 main cameras and 2 audio listeners, which would then give me an error. ALSO, all the scripts in the, “Game scenes” that have public GameObject variables that connect to THAT player in THAT scene would not re-reference itself to the “Player” from the old scene that I wish to use and keep. As you could see, this problem happens because in all my game scenes, I already HAVE a game object called, “Player” with a camera attached that I am using for a whole entirely different purpose. What if every time I want to run my game, I don’t want to have to disable all my, “Players” and “Cameras” in each and every Game scene, and every time I want to run a ‘virtual player’ in my Game Scenes with the same name (to see how my player would ‘adapt’ to its environment), I don’t want to have to re-enable that player? What if I want my “Player” object from my main scene to ‘replace’ the “Player” object from the future scenes that load up and not have to ‘rescript’ each variable that references to the “Player” in THOSE scenes to re-reference itself instead to the Player I don’t want destroyed without the ‘replacement’ of the Player object to cause all references to show up as, “Missing” game objects? I think ReplaceOnLoad() would be a great new feature to have.