2D Character flipping around & Tilemap edges?

Hello all, still pretty new to Unity, but I’m trying to make a 2d game and am having a couple of issues. Firstly, for some reason, after setting up collision with two of my tilemaps, I’m having a strange problem where my character is treating it kinda like they can walk up it? I’ll post a picture to go along with it so you can understand, but they’re flipping around when they’re definitely not supposed to so I’m wondering what I did to cause that. My character has a BoxCollider2d and a RigidBody2d (set to dynamic if that matters), and the tilemap layers both have tilemap collider 2d’s.

Second problem I’m having, which you’ll also be able to see in the picture, with the tiles that I have, when I set it to auto cut them some of them still have edges and are grabbing some of the next bit of tiles. Any way to cut them off without having to edit the whole tile in the sprite editor? Thank you for your help!

Hi,

Have you already tried to freeze the z-rotation in the player’s Rigidbody2D component? Maybe that’ll prevent your player from tilting.

Regarding the lines in your screenshot, you could try to set the Filter Mode to “Point” in the Texture Import Settings.

I hope this helped. If it didn’t, please feel free to ask our helpful community of students for advice over on our Discord chat server.


See also:

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

Privacy & Terms