Hello, i’m very new to unity and i’m confused when it comes to game objects. So i’m making a 2D platformer and i have a floor object and i want to put a lot of them into the scene. I come from Game Maker Studio so what i thought was you make an object then put as many instances of that object into the room but if this is the case i cannot for the life of me find how to do this. The only other option i can see is duplicating a crapton of my floor objects for each one in the scene. Please help!
You might find the answers you need here: Learn game development w/ Unity | Courses & tutorials in game design, VR, AR, & Real-time 3D | Unity Learn
1 Like
@ladyonthemoon is right; you should spend a week or two working your way through tutorials, as it will save you literally months of fumbling about learning things the hard way.
But to your specific question: the standard solution here is use a Prefab. The basic procedure is:
- Configure one floor object the way you like it.
- Drag this from the Hierarchy tab to the Project tab, which creates a prefab and converts the floor object in the scene to a reference to that prefab.
- Then either duplicate that object in the scene, or drag the prefab back from Project to Hierarchy — these both do the same thing, which is to create more references in the scene to that one prefab in the project.
Learn how to use Prefabs in full, their main purpose is to do what you describe, but they are a very valuable tool for many reasons and probably one of the first tools Unity gives you that you will find your own purposes for away from any tutorial.
Everything you need to know about Prefabs: