Quick issue with Vehicle tilting relative to ground(PLEASE HELP)

Ok so, i have a system so the vehicle tilts when going up a down hill

https://gyazo.com/4e723e077be61cf79839b4bfba592f26

works fine in a straight line

but as soon as I turn

https://gyazo.com/4e723e077be61cf79839b4bfba592f26
it breaks
line of code that handles it

rotationX = (rayFront.Position.Y-rayBack.Position.Y)*2

thank you in advance

Also, the vehicle is a hovercraft.

Heres clearer photos for those who are confused


Are you sure that the "rayFront "and “rayBack” variables are correct? I got a question what does “rayFront” and “rayBack” hold? Is it an instance?

Never mind someone on hiddendevs discord solved my issue. I had to use :toobjectspace

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.