Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Pipe | |
Old Version | Published before Godot 3 was released. |
I’ve created a TileMap using a TileSet and successfully created a map using one of the
official tutorials. I’ve also created a player sprite with a KinematicBody2D and a CollisionShape2D with a capsule shape. The problem is that when I move the character using the arrows, it gets stuck in between the tiles and on top of the slopes, which makes it completely unusable.
This is the code: Godot character 2D - Pastebin.com
Any ideas? Thanks.
EDIT: I tried using a rectangle shape for the collider and it works perfectly, but now I’m confused. Shouldn’t the capsule work better, as it’s rounded? Circles don’t work either.
Capsule is not better, is different (personally, I prefer rectangles because they get simple normals).
Check the normals when the capsule stop moving, maybe is a gap and you are not controlling that situation.
And if on 2.1.3+, be sure to turn on Project settings>Physics 2D>motion_fix_enabled
, that will solve some issues when sliding.
eons | 2017-07-11 02:42