- Home /
Why is there a gap between my player and the wall during wall slide? SOLVED
I'm not sure what happened, but when I try to wall slide against a wall, the player's wall slide animation starts but there's a weird gap between the player and the wall. Any help would be appreciated.
SOLVED: I was able to figure out the problem, the pivot point of the sprites weren't directly on the player. I just moved over the pivot and it worked. Thanks for the help!
Answer by rh_galaxy · Mar 28 at 09:08 PM
It might be too big Default Contact Offset in Settings->Physics 2D? Default value 0.01 is 1 cm if you follow the Unity standard 1.0 unit = 1.0 meter.
Answer by ZBerm · Mar 28 at 10:59 PM
I wouldn't go changing the Physics 2D settings just yet, especially if other collisions are working correctly.
Does your slide animation bring the pixels of the player's sprite in towards the center of the sprite, while keeping the sprite bounds, or the player's collider2D the same width as the non-sliding player sprite?
Can you post a pic of the scene view with gizmos on and the player selected so we might see exactly where the colliders and sprites are, and compare them to a standing idle animation with gizmos shown.
I'm sorry, I'm still a beginner to Unity and not quite sure exactly what you mean?