The angle does not add well

Hello developers !!
I am trying to make a car through scripts and BodyMovers, to obtain the angle that the car should have, I have 2 calculations, one which gives me the exact same given its previous CFrame and another that depends on the previous CFrame, so, I did:

local Axis = Vector3.new(0, 1, 0):Cross(Raycast.Normal)
local Rotation = Axis:Dot(Axis) > 1e-6 and CFrame.fromAxisAngle(Axis.Unit, math.acos(Vector3.new(0, 1, 0):Dot(Raycast.Normal))) or CFrame.new()
					
local rX, rY, rZ = Rotation:ToEulerAnglesXYZ()
local rX1, rY1, rZ1 = BodyGyro.CFrame:ToEulerAnglesXYZ()
					
BodyGyro.CFrame = CFrame.Angles(rX, math.rad(DirecctionX * DirecctionZ * 3 + rY1), 0)

Worse for some reason, in the Y it doesn’t spin well:
https://streamable.com/male8q

ah, I also tried taking the sum out of the math.rad, but it only allows to rotate half:

Any ideas?

1 Like