Help with using script to rotate an imported mesh around a custom pivot point

I’m new to scripting (more of a builder) so please go easy on me.

I want to rotate a mesh using CFrame but its off centered somehow. I imported it from blender and on blender, the mesh was centered to the 3D cursor like this:

But when rotated using CFrame, it isn’t centered:

This is the code I use to rotate it.

local fan =

while wait() do
	fan.CFrame = fan.CFrame*CFrame.Angles(0, .05, 0)

How do I create a custom pivot point using CFrame to center the mesh? Google points me to setPrimaryPartCFrame but I’m not sure how or where to code it in. I’ve tried remodelling the mesh but it’s always off centered on studio.

1 Like

Add an attachment in the direct middle then use that as your pivot point.

How do I do that? I’ve inserted the attachment and positioned it to the center. What’s next?

Bump because I still can’t find a solution. (Hope it’s allowed)

Kinda a complicated response and probably a better way but I made a part and made it a anchor. Even scales to size.

local Fan = script.Parent
local RunService = game:GetService("RunService")
local FanOrientation = Fan.Orientation

local Anchor ="Part")
Anchor.Name = "Anchor"
Anchor.Anchored = true
Anchor.CanCollide = false
Anchor.Size =, 0.01, 0.01)
Anchor.Position = Fan.Position
Anchor.Color = Color3.fromRGB(255, 0, 0)
Anchor.Transparency = 1
Anchor.Parent = game.Workspace
Anchor.Orientation = FanOrientation

local Weld ="Weld")
Weld.Part0 = Anchor
Weld.Part1 = Fan
Weld.C0 = / (-0.25 * 185), 0, Fan.Size.Z / (-0.4 * 65))
Weld.Parent = Anchor

	Anchor.CFrame = Anchor.CFrame * CFrame.Angles(0, .05, 0)
1 Like

Thanks so much! You helped me a ton.