Question about scenes vs projects

I have now created a few different scenes for a prototype.

I tried to attach a new script to my Player in the new scene and imagine my shock when this new script was then also attached to my Player object in my already completed and saved scenes!


WHAT?! Luckily I caught this before changing literally anything except the script name. But surely there must be a ‘right way’ to do this. Do I have to create a new player object in the new scene, and just attach the new script to this new player object?


Or is it better to simply create a new project, bring over the scripts and objects I want, and at some point merge them?


I was just so shocked at this, and after having done 6 weeks of tutorials, nothing prepared me for this, as they always deal with a single scene.


Am I missing something? Am I envisioning a new scene in the wrong way? I do conceive of it as a new level, but with new levels, new behaviors/abilities/powers are surely expected.

The object you’re attaching your new script to is a Prefab

What are prefabs? (if you’re interested)

Think of individual parts like a mesh, a script, even materials or whatever else as Lego pieces
a prefab is the full Lego built, the combination of all parts
prefabs are very handy as changes made in one place are replicated to all instances of that prefab, lets say you have a bunch of enemies in a scene, you just need to change the prefab once, and not every enemy individually.

How do you fix your problem?

In your project window you should just make a new folder called “Prefabs” and drag your old object into it. then make a copy of that, that can be a child or not, depending on what you want to do with it in the future, and attach your new script to it.

I was able to, in my new scene, right click on my Player Object, and select Prefab → Unpack Prefab completely.


This way any scripts I remove or add in my new scene do not affect my player.

I think I had forgotten I even had a prefab attached (probably wasn’t even intentional). Thanks Babitch.