0 votes

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.

in Engine by (65 points)

1 Answer

+1 vote
Best answer

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.

by (134 points)
selected by

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.