Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

Questions about movement on uneven/slopped terrain and terrain coliders

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

  1. ssbbb


    Jun 3, 2019

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

    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.