Lesson 2
Models and organization
Goal: Group parts and move them as one.
about 5 min3 practice exercises
A world with 500 loose parts called "Part" is impossible to work in. A Model is a container that groups parts so you can select, move and copy them as one thing.
- Select the parts and press
Ctrl + Gto group them into a Model (Ctrl + Uungroups). - Rename it in Explorer straight away:
Tree,Shop,SpawnArea. Alt + Llocks a part so you cannot select it by accident in the viewport. Lock the ground once it is finished.
A model has a PrimaryPart: the part its pivot point and bounding box follow. Set it in the Properties window. Without one, the model moves around the center of its bounding box.
From code, move a whole model with PivotTo. It moves the model and everything inside it:
local shop = workspace.Shop
shop:PivotTo(CFrame.new(0, 10, 50))
Use Folders for things that belong together but are not one object, such as all the coins in a level. A script can then loop over the folder's children.
Try it in Studio
Optional, and the best way to make it stick.
Group your room into a Model called Room, set its PrimaryPart to the floor and duplicate it.
Sources
Checked against Roblox's documentation on . The lesson is in our own words; these pages are the source of truth.