I have a vehicle that needs to move on a randomly generated terrain and handle slopes. I'm not using wheels, but instead moving the vehicle with velocity. The ideal case would be if I can make the vehicle rotate according to the terrain edges and move smoothly as shown here:

Diagram of a green square sliding down a black terrain, rotating to match the ground

How can I accomplish this? Launching raycast from the bottom left angle and calculating the distance from the ground, then rotating according to that?



You must log in to answer this question.

Browse other questions tagged .