Sprite flipping through barriers

Since my Capsule Collider 2D is off-center in relation to the Player GameObject, when I change directions next to a wall the sprite flips horizontally and the collider is now behind the foreground object.

This causes my character to plummet to infinity. While this could be a useful mechanic, how do I prevent it for now?

image


Hi,

Welcome to our community! :slight_smile:

Does the ground have a collider attached?

1 Like

Yes. I ended up fixing the slicing on my spritesheet to center it on my GameObject. That solved the issue.

Originally I tried to slice the spritesheet without padding. Adding the padding fixed everything.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms