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

How would I create a part in the center of a model?

I'm trying to create a part using instance.new("part") and then set the CFrame or position to the center of a model. I've tried getBoundingBox() but that didn't seem to work. Any ideas?

--My attempt
part.Position =  MainVehicle:GetBoundingBox().Position

2 comments

0

You can assign a center part as the PrimaryPart, then call Model:GetPrimaryPartCFrame().p

0

The primary part isn't always the center.

1 answer

✓ Accepted answer

Use Model:GetModelCFrame().Position roblox deprecated Model:GetModelCFrame() for some reason, but it still works perfectly fine.

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