This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
+2 votes

I've been trying to develop a pinball-like game prototype, using the TileMap system as a way to draft out boards and I've come into an issue whereby when the pinball moves too fast and collides with the TileMap walls, it will sometimes register multiple hits from more than one tile and at different angles.

As the main wall tiles in my kit have the collision shape of a square, when the pinball moves even moderately fast and manages to hit near or on the border between two tiles, it's getting hit normals from the side and corner of one of the collision squares when I just want it to only ever hit the exposed surface of the wall.

I have tried...
- Increasing the Physics Fixed Timer (helped moderately by making it 120, but it doesn't seem to get much more reliable at a much higher timer)
- Using the Segment CollisionShape. Instead of the above the pinball just freaks out.
- Tweaking the Solver Bias
- Trying to use One-Way Collision
- Use Continuous Collision Detection, both types
- Changing the shape of the CollisionPolygon to prevent the pinball from reflecting off the side of the tile when not exposed - but as it still hits the corner of the adjacent tile this made no difference

Is there any way I can automatically merge the surfaces to prevent this instance, or would a custom collision solver be able to help this in any way that makes the result 100% reliable? I can hand-craft the collision bounds if need be, but especially for having to trace over curved walls accurately id rather a different solution.

in Engine by (23 points)

If you get multiple hits at different angles for a single collision on a wall, I think that would be a bug in Godot. Does the ball moves correctly besides that?

I have the same problem on 3.0.6 (also on 3.1 even with the new TileMap/TileSet system).

I have a very simple scene with a floor made of tiles with StaticBody & Rectangle shapes plus a "ball" with RigidBody & Circle shape and bounce of 1. You start the scene, the ball drops (gravity), hits the floor and often collides with many tiles -- sometimes hits a tile corner, and bounces oddly off instead of just bounce up as you would think.

I get the feeling this is not a bug per se, it just is a technical incompatibility with tile-based collisions & rigid bodies?

1 Answer

0 votes
Best answer

If the ball goes too fast against a wall, soft curves wont matter much, you can try adding a layer of static blocks on the problematic parts and make the ball add this layer to the mask when reaches a specific speed.

by (7,954 points)
selected by

Sorry for not responding sooner, but this was a good solution - i bumped up the static physics fps and kept some tiles that don't have physics so I can just put solid blocks there instead.

@Takanu Kyriako - thanks for your comment (this saved me a lot of time!). I was having an issue with fast moving sprites not colliding with my tilemap and by changing the physics fps in settings (I went with 120), I am now getting collisions being registered.

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.