Hello, I need help with a script. This script rotates around an axis, it works very well when the model has a rotation of 180 but if I rotate it to 90 then the object will rotate on itself. In addition, I would like to be able to subsequently move the model with a rotation between 180 and 90.
local newpivot = CFrame.new(sp.ElevationPivot.Position) --Pivot point
local offset = newpivot:toObjectSpace(part.CFrame)
newpivot = newpivot * CFrame.Angles(0, 0, math.rad(nbr))
part.CFrame = newpivot * offset
My question : How put good numbers in CFrame.Angles depending on the orientation ?