Search Unity

Sprite Snagging On Box Collider

Discussion in '2D' started by SaamBell, Feb 1, 2015.

  1. SaamBell

    SaamBell

    Joined:
    Mar 28, 2014
    Posts:
    128
    Hey guys! I've been trying to get to grips with 2D game design and decided to follow a tutorial on how to make Pac-man. Everything was going fine and i managed to get the character moving and the correct animations responding. The only problem is when i play the game, if my sprite goes too far into a wall he will simply stick to it and will not move from it (as shown below) forcing me to restart the game.
    pacmanhelp1.png


    In this image you can see all the box colliders that i have used to segment the walls in my game. The colliders are pretty much spot on so i have no idea why the sprite is getting stuck on walls. pacmanhelp2.png

    This is the sprite with his cirle collider/rigid body attatched.

    pacmanhelp3.png

    Anyone got any idea how to fix this as stumped rn?
     
  2. ColossalPaul

    ColossalPaul

    Unity Technologies

    Joined:
    May 1, 2013
    Posts:
    174
    Hi,

    It might be a legitimate problem with the collider getting stuck in wall. We'd appreciate if you could create a test case and file a bug report.

    If it were me, I'd ditch all physics in the game of Pacman since he moves in a predefined path.