Search Unity

Sprite with box collider gets stuck on nothing

Discussion in 'Physics' started by Cjmarkham, Sep 13, 2015.

  1. Cjmarkham

    Cjmarkham

    Joined:
    May 30, 2014
    Posts:
    41
    I have a controlled sprite using a rigidbody 2D and AddForce. For some reason the sprite seems to get stuck when there is nothing to get stuck on. Force is still being applied to the sprite but it refuses to move.

    The rigidbody 2D is set to "Fixed Angle". If I remove this then the character will keep moving past these points, but flip 90 degrees when it hits one of them.

    The location this happens is random but the following screen is from one of these times.

    Untitled.png

    As you can see, the ground (also sprites) have a rigidbody 2D attached but there is no intersection or collision that would prevent movement. If the character jumps over this section then I can move around again (even over the same spot it got stuck initially).

    Here is another screen from a 3D perspective

    Untitled.png
     
    Last edited: Sep 13, 2015
  2. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,350
    He actually gets stuck on the edge of the tiled surface, try to give the collider a physicsmaterial with 0 friction,
     
  3. NotASquid

    NotASquid

    Joined:
    Jan 20, 2016
    Posts:
    2
    This seems to work for me. Thanks alot Gorbit! I've been struggling with this issue for a while now.