Characters get's stuck on tiles and when using a capsule for the collision shape there is another problem

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

Hello.
I am working on a game that the terrain in the game is auto generated and it uses tiles as for the ground, the player character is a rigidbody2D that the friction of it is 0 but sometimes it gets stuck on ground and when falling down and colliding with a wall so i have found this post about it and tried using some other form for the shape of the collisionchape2D of the player character instead of a rectangle, like a capsule for it:
https://forum.godotengine.org/11217/rigidbody2d-jaggy-movement-against-tile-collision-and-walls
but this happens (the character is moved to the air and falls down when on a tile when in some certain positions like in the video):

Edit:
The player character is a rigidbody2d in the character mode and here is the code for it character. note that i disable some thing in the code for testing like jump only on ground:
http://paste.ubuntu.com/24805985/
Here is a picture of the nodes in the scene for playing:

Here is a picture for the nodes in the scene for the tilemap:

So how can i fix this?

:bust_in_silhouette: Reply From: rredesigns

Well, first of all, that’s what KinematicBody2D was made for. Using rigid bodies for characters is a bad idea.

Anyway, I found that using kinematic bodies you can slide by the normal, so if it ever collides it will try to complete the motion by sliding, which is pretty neat. Unfortunately since those doesn’t react to physics you have to simulate gravity and other forces by code, but that’s an extra layer of control.

Since your character isn’t rotating, I asume it is a rigid body in character or kinematic mode. You need to describe a bit more what you have done, the code you are using and your nodetree, otherwise is hard to guess what’s wrong.

Edited my post.

Hormoz | 2017-06-08 05:47