Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I set the PrimaryPart of a model?

Asked by
chrono2 189
7 years ago

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.

0
Was this really necessary.. you set it. model.PrimaryPart = model.Part Goulstem 8144 — 7y
0
I tried that, and it said it was still set to nil, even though the part was inside of the appropriate model. chrono2 189 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago

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!

0
Even looking for it I didn't see it in the properties viewer... I'm so sorry. xD chrono2 189 — 7y
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. MrLonely1221 701 — 7y
Ad
Log in to vote
0
Answered by 7 years ago

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

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

Answer this question