0 votes

I have a TileSet with tiles that has StaticBody2D and CollisionPilygon2D.

Since the collision polygon is drawn by hand, the connection between the tile is not perfectly seamless. The right side of one tile might be higher than the left side of another.

In the main scene, I construct platforms out of these tiles.
The is also a Kinematic character with a collision polygon. I use the move function to move around and jump.

The problem is that because there are seams in the tiles, the character is stuck and can not move when on the ground.

Since platform game is rather common use-case of Godot, I guess I did something wrong.

enter image description here
enter image description here

in Engine by (262 points)

1 Answer

0 votes

Your grid is activated but you don't use it. I suggest to anchor the shape corners on the grid to have more accuracy (look at the official tilemap tutorial ).
Then use a raycast as a collision shape for your kinematic body.

by (515 points)

Thank you. After fixing the misalignment with the grid, I still had problems. Followed http://docs.godotengine.org/en/stable/learning/features/physics/kinematic_character_2d.html which cleared the issue for me. One note though, using raycast does not help and actually makes things worse. The technique described in the link above does not work with raycast. It took me some time to figure and switch back to rectangle.

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 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 webmaster@godotengine.org with your username.