Hi y’all! I’m trying to make a part move and rotate through the specified waypoints while the front surface faces them but I ran into a problem: sometimes it makes a weird rotation and instead of going to right (like an obvious choice) it rotates to left and makes something like almost a 270° or 360° rotation.
I have 2 tweens, one for position and one for orientation. I’m not using CFrame (but I tried with it) to tween both because I want the orientation tween faster than position.
And here’s how I’m trying to do it (tweening orientation):
local CFrame = CFrame.lookAt(part.Position, waypoint.Position)
local X, Y, Z = CFrame:ToOrientation()
local Tween = TweenService:Create(part, TweenInfo(0.25), {Orientation = Vector3.new(math.deg(X), math.deg(Y), math.deg(Z))})
Tween:Play()
I tried using math.rad and also leaving them like that but the part doesn’t even rotate. I saw using math.deg converts it to degrees (because looks like CFrame returns it on radians, not sure about it) and fixes it but my problem is about how the part rotates to the left or right to face the new waypoint (because sometimes it rotates to right side doing a whole turn and the waypoint was at its left side)