Help with CFrame (Angles) arround a part

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 ?



1 Like

It’s easier to use a HingeConstraint set to Servo then set the TargetAngle of the Servo.
Or use a Motor and set the DesiredAngle.

Both of these were in the lawnmower model I sent you in a previous post. The HingeConstraints were in the arm. The Motor was used for the steering.

I see, but the problem is that the hinge constraint does not work with small values…