Search Unity

Player cube getting stuck on cube gameobjects

Discussion in 'Physics' started by Bazoozoo, Apr 21, 2015.

  1. Bazoozoo

    Bazoozoo

    Joined:
    Mar 27, 2015
    Posts:
    28
    I have a cube moving with a rigidbody AddForce function ontop of some cubes of the same height, however when the player cube moves over to a new cube tile it gets stuck momentarily or hits the other cube despite having a slippery physics material property with no friction etc.
     
  2. renaissanceCoder1

    renaissanceCoder1

    Joined:
    Apr 8, 2015
    Posts:
    127
    Just a couple of questions:
    1. Are you starting the player cube above the ground? (To ensure his collider is not slightly stuck inside the ground collider)
    2. Is your AddForce vector moving on only one axis? (i.e. (1, 0, 0))
    3. Do you absolutely need to use AddForce? Try using transform.Translate just to see if it causes the same problem. Then try modifying rigidbody.velocity instead.

    Let me know what you find.