Collisions aren't working properly

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By congbinh75

I’m working on a simple platformer project.
I’m using KinematicBody2D as the main character and some tiles using Tileset (StaticBody2D).

Check this video

While testing, i found that the collisions seem like not working properly. The character seems to be floating around while moving left and right. And when it hits the wall on the right and stop moving, the character is not really “touching” the wall. There is a small distance between them when the character is not moving to the right.

Thanks in advance.

:bust_in_silhouette: Reply From: fossegutten

This is how the KinematicBody2D works in Godot. It registers a collision before overlapping with the colliding object. There is an collision/safe_margin that defaults to 0,08. You can try turning it down. I have made a lower resolution game myself, to avoid this.

I haven’t known it. Thank for your help !

congbinh75 | 2019-06-25 03:46