Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Questions about movement on uneven/slopped terrain and terrain coliders

Discussion in '2D' started by ssbbb, Jul 6, 2019.

  1. ssbbb

    ssbbb

    Joined:
    Jun 3, 2019
    Posts:
    5
    Hi,

    I have a few questions related to the game I'm developing.

    https://postimg.cc/hJWppdpQ

    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 (like shown in the picture).

    What would be your approach to this? What will be the standard way to tackle it? Launching raycast from the bottom left angle and calculating the distance from the ground, then rotating according to that?

    Also, what is the best collider for that kind of terrain? I'm planning on making it destructible, so it can take any shape.