Search Unity

Character stuck walking on a BoxCollider2D

Discussion in 'Physics' started by StealThePixels, Jul 22, 2016.

  1. StealThePixels

    StealThePixels

    Joined:
    Apr 2, 2015
    Posts:
    68
    I have created 2 equal pieces of ground and i have placed a character on them.
    Often when the character walks it gets stuck while it is entering a new piece of ground.
    Either direction, left or right.

    In the image you see that the character is walking to the right, entering a new piece of ground, and it is stuck there, it only can walk backwards , or jump forward to be able to stand on the piece of ground on the right.



    What may be the cause?

    I have also assigned to the ground's collider a PhysicsMaterial2D with 0 friction and 0 bounciness.

    Also: the character has a BoxCollider2D, and it has an empty child Gameobject called "feet" with a BoxCollider2D. The latter handles the collisions between the feet and the ground, to detect when the character is on the ground and not jumping.
    As you can see, both character's and feet colliders are above the ground, not aside. So they should be able to go to the right, no?
     
  2. StealThePixels

    StealThePixels

    Joined:
    Apr 2, 2015
    Posts:
    68
    CaligolaGG likes this.