How to set model's pivot offset to center with a script?

I’d like to reset model’s pivot offset to it’s 0,0,0 position (Center of model) with a script, so when using :PivotTo(), the model will pivot with it’s center.

How would this be achieved?

2 Likes

Off the top of my head it’s just model.PivotOffset = CFrame.new(0,0,0)
I’m not sure on behaviour if it has a primary part set though.

2 Likes

The solution for this was simple. Previously It was giving me weird offsets, due to me having no primary part in the model.

Having primary part in the model made the pivot offset customizable, and no matter the condition whether the model is unanchored or anchored, the pivot offset always stayed in the center.

I appreciate the reminder about the primary parts.

Solution: Always have PrimaryPart in your model, when working with :PivotTo() or anything else pivot related.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.