How can I make a part rotate around a sphere on only the X and Z axis, always pointing towards the cursor?

I need the part to be able to rotate on the X and Z axis on a sphere that will roll. The part that is being rotated has to always face the cursor, but still be perpendicular to the sphere.

How would I do this with CFrame?

(like a turret)

A post was merged into an existing topic: Off-topic and bump posts

I would use a Body Gyro, and set the MaxForce for y to be 0. Maybe you could also use a bodyPosition, and keep it positioned on the sphere, or an align position constraint Mouse Follow.rbxl (44.6 KB)