How i would go about this? I have my scene setup with tilemap. Each block on map have 2d box collider and 2d rigidbody(kinematic). And my player have 2d box collider and 2d rigidbody. And i tried AddForce but it’s jerky, then i tried coping from 2D sample project and it works, but sometimes it’s just stop moving and i have to press other direction to “unstuck” myself, and it’s just terrible. I also tried using Translate but then my physics is not applied.
Any ideas/samples?
Hey Ivan,
The problem you are experiencing is common. It’s because of the way you’ve setup your colliders on your player. To avoid the sudden stops where you have to change direction to keep going you’ll need to have a BoxCollider2D at the top section of your character and a CircleCollider2D as your base. This will remove any chance for the character to get “stuck” when moving. See below reference image for collider setup. I hope this helps!
Hello, I have this collider setup for my character, but I have a problem with the terrain vertical edges. When the character is too close to the edge, he is moving forward and jumping it seems like he is attached to the edge and climb it. It is because the colliders setup? I’ve tried only with the circle collider and the box collider and it’s the same.
Any ideas?
Thank you
In the Assets, create a Physics Material 2D with friction to 0 and drag it into your Box Collider 2D. And it will work 