Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Player object getting stuck on nothing (tried common fixes)

Discussion in '2D' started by DanML, Jun 12, 2014.

  1. DanML

    DanML

    Joined:
    Jun 12, 2014
    Posts:
    2
    I just started Unity the past two weeks and have been doing pretty well so far. One problem I can't seem to find any where online is this: My player (currently a square) will be running along the ground and stick in seemingly random places. I have tried many different fixes to no avail. The collider on the player isn't even touching the colliders of the ground, so what gives? In addition, the entire ground has been changed so it gives 0 friction. Here is an image of a currently stuck player:
    http://puu.sh/9pz5d/5b01d12cf1.png
    as in, when I hold the right arrow key, nothing happens. If I jump or walk in the other direction it unsticks, and I am able to go over that section again. It only happens sometimes, and seemingly at a different corner each time. But it always seems to be in the corners of the ground.
    zoomed out: http://puu.sh/9pzfS/67e913cb57.png

    As a fix I'm sure I could link all of the top-ground pieces together as one collider, so that there are less corners, but I don't really feel like I'm fixing the issue and it could easily come back and be a problem later. Does anyone know why this happens?

    Side question: I read that turning on "interpolate" on my player would make movement much smoother/less choppy, but when I turn it on it actually makes my movement worse, whereas currently with no interpolate it's fairly smooth. Any reason for that?

    Thanks for any help you can give me.
     
  2. DanML

    DanML

    Joined:
    Jun 12, 2014
    Posts:
    2
    bump
     
  3. christides11

    christides11

    Joined:
    May 19, 2012
    Posts:
    667
    I would definitely suggest just making the entire floor one collider, helps performance-wise and with the problem. Would also suggest to make the character zero friction.
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    2,519
unityunity