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

Ways to get the center position of model?

I'm working with viewport frames right now and I need to be able to center a model, however there is no position property for models. The model's primarypart exists but it is not in the center. Is there any ways to get the center position of a model and if not, I would like to know the best way to work around it.

2 answers

✓ Accepted answer

I assume you can do this by using Model:GetBoundingBox().

local model = workspace.Model
local orientation = model:GetBoundingBox()
local position = orientation.p

I haven't tested this code out however.

1 comment

0

I just found out about this

Ok, I found out how to do this after looking in a bit more about models. There is a function which is :GetBoundingBox() and it returns the CFrame and size of the bounding box of a model.

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