RigidBody2D jaggy movement against the tile set collision and walls

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Serenade
:warning: Old Version Published before Godot 3 was released.

Hi!
Im trying to make a character(Rigid2D) to move and i have this annoying problem when it runs on objects that even have perfectly aligned collisions( tileset floor) it either stuck until you move other direction or it like bumps over it…
How can i smooth it out, like on the kinematic2D?
Thank you! :slight_smile:
(always problems with movement and collision, kinematic or rigid… : D )

When you made sure colliders are aligned, did you use pixel snap?

Zylann | 2016-12-31 23:29

This is common (even on Box2D and others) and expected, sometimes all the shapes you try may fail depending on your settings, look at the Platformer demo to learn how to deal with rigidbody characters using custom integrator (_integrate_forces).

eons | 2017-01-01 19:50

jep, in tile set :wink:

Serenade | 2017-01-01 23:06

:bust_in_silhouette: Reply From: YeOldeDM

Your issue could be caused by the shape of your player’s collision box. If you have a square/rectangular collision shape, its sharp corners tend to want to ‘stick’ against the collision shapes of tiles (even if everything is aligned pixel-perfect). At least that’s what I’ve found in my experience.

The solution there is to use a Capsule/Circle type collision shape. Or my personal fave, the “Pencil”.

enter image description here

Thanks, that did help!
But still, my character stucks on walls when i jump-hit into them… : /

Serenade | 2017-01-01 23:06

I have almost the same issue, but

  1. It’s in 3d
  2. Player’s collision shape is set to capsule already
    But it’s still bumping up. I know why, but i don’t know how to fix this.
    When i overlap 2 collision shapes, the crossing area increases it’s thickness. Even if they’re standing near each other, they still create a seam, where the player bumps up
    visualized issue

SmallHum | 2022-10-19 17:20

:bust_in_silhouette: Reply From: popcar2

Adding to what YeOldeDM said, this is an issue with Godot collisions that still hasn’t been fixed

I made a tool that pre-bakes colliders for tilemaps until it gets resolved. It creates one big rectangle collider for each row of your tiles, ensuring other colliders will slide around smoothly on floors. Hopefully it can fix your issue for now!