Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I set the PrimaryPart of a model?

I'm trying to move an entire model using MoveTo:(), but I don't know how to set the PrimaryPart of it, because it's currently set to nil.

2 comments

0

Was this really necessary.. you set it. model.PrimaryPart = model.Part

0

I tried that, and it said it was still set to nil, even though the part was inside of the appropriate model.

2 answers

✓ Accepted answer

The easiest way to do this, is to select the model and in the Properties viewer, select "PrimaryPart" and then select the part you wish to be the primary. An easy way to move it after this is

workspace.Model:SetPrimaryPartCFrame(CFrame.new(0 0, 0)); -- The 0, 0, 0 can be any Vector3 coordinates you desire and it will more the model with the primary part where you position it with this command.

Hope this helps!

2 comments

0

Even looking for it I didn't see it in the properties viewer... I'm so sorry. xD

0

At the top of your studio you should see a button that says "View" click that and look for Properties and select that. Then try what I said.

Using that guys code^^ But this is to set the part, not the C-Frame

game.Workspace.Model:SetPrimaryPart(Part name here)

This discussion is preserved as it was. New answers, comments, and votes are closed.