My goal is to rotate a part around a vector as visualized in red in the image below. The transparent part shows it’s initial orientation, and the part on the left is the result I’d like to achieve, while the part on the right is the current result.
As you can see, instead of rotating around Vector.new(1,0,0), it rotated around part.CFrame.RightVector. How do I fix this?
My code:
local part = script.Parent
local angle = math.rad(45)
local axis = Vector3.new(1,0,0)
part.CFrame *= CFrame.fromAxisAngle(axis,angle)