0 votes

So I have this bouncing ball which is a rigidbody2d with the bounce property in the physics material set to 0.6, and a tileset with collision set up. The issue is that sometimes when it bounces off from the ground it goes in the wrong direction, see at the end of this video. This only happens with tiles, I tested with a static body as the floor, and it worked just fine. I assume that this is because each tile has its own collision shape and when it bounces close to where two tiles meet it bounces from the side or from the corner of a tile.

Anyone has an idea how to fix this?

Godot version 3.4
in Engine by (19 points)

1 Answer

0 votes
Best answer

So I figured it out myself after a bit, but here is the solution for everyone reading this in the future. So the issue was indeed caused by the tiles collisions being separate, and to solve this I used this little script made by Ratty. It combines the collision shapes into one single polygon and passes it to a StaticBody2d, just be sure to disable the TileMap's collision.

by (19 points)
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.