Search Unity

Unity 5 terrain bug?

Discussion in 'Physics' started by JoeyCamaro, Sep 12, 2016.

  1. JoeyCamaro

    JoeyCamaro

    Joined:
    Feb 25, 2015
    Posts:
    23
    Is there a glitch or bug with the terrain? My stupid cube travels right through hills. Tried everything, nothings working
     
  2. dudester

    dudester

    Joined:
    Oct 25, 2014
    Posts:
    371
    What code are you using to move the cube ?
     
  3. FreeFly90

    FreeFly90

    Joined:
    May 28, 2016
    Posts:
    177
    Are you sure you are using physics to move the cube and not transforming it by just moving its position?
     
  4. DroidifyDevs

    DroidifyDevs

    Joined:
    Jun 24, 2015
    Posts:
    1,724
    If you're using something like transform.Translate to move the cube, switch to Rigidbody.AddForce or Rigidbody.MovePosition.

    Make sure your cube has a collider and the terrain has a collider. If you move the cube manually by dragging it in the editor, that will also make it go thru hills.