Quick issue about tilting vehicle depending on ground(PLEASE HELP)!

As you can see it works perfectly fine on surfaces that are less then 180 degrees
image
but as soon as I past it,
image
it stops working
here’s the code

rotationX = ((rayFront.Position.Y-rayBack.Position.Y)*3)
rotationX = CFrame.Angles(math.rad(rotationX),0,0):ToWorldSpace()
vehicle.Body.BodyGyro.CFrame = CFrame.Angles(0, math.rad(rotationY), math.rad(rotationZ)) * rotationX
1 Like

this wont be helpful but when i used cframe angles when it past 180 degrees it started to glitch aswell it was a turning head but i dont think this will be that helpful for you, you tried math.rad aswell

I think you might need to use the RayResult.normal, which is basically the direction a surface is pointing at.

vehicle.Body.BodyGyro.CFrame = CFrame.new(rayBack.normal) --Or CFrame.angles

^^ not tested

1 Like

didn’t work. i have no idea why its not working past 90deg

Still wont work, i still donw understand why??? any ideas guys???