Open Yann-Situ opened 1 year ago
Still relevant in 4.1. It also makes a simple rolling ball bouncing for no reason on flat ground. If it can't be fixed without baking I think this option deserve to be included in the Tilemap tool
Can confirm this issue on v4.1.1.stable.official (ignore gravity changes, these are triggered by keyboard) As you can see collisions seems to work weird in between tiles. (bounce is disabled on this clip, yet the ball "skips" sometimes, like it has hit something.)
https://github.com/godotengine/godot/assets/109681545/8426140a-9e10-41a9-b7ff-8ba899711e4f
Encountered this problem while developing my current game, where I kick a ball creature around to finish a level. The ball is implemented using RigidBody2D to make it's behavior realistic. I avoid most of the problems by prebaking the collision shapes into the tilemap but it doesn't work with slopes, which I still have configure manually in a tileset. The bug discussed here produces several problematic scenarios, all happening because the ball hits the edge between tile and slope collision shapes.
https://github.com/godotengine/godot/assets/34010694/a2adbb06-98db-40c1-a179-c0593f073651
https://github.com/godotengine/godot/assets/34010694/a0b9aacc-9908-4595-b53d-7463675a9405
https://github.com/godotengine/godot/assets/34010694/1d8a29a7-4dbf-4fb3-9098-b52ea98c71a7
https://github.com/godotengine/godot/assets/34010694/a9e71c25-96c8-4207-8750-46a683345ddf
As you can see, this is rather nasty bug and I would dare to say that it should take a high priority as it can deter some Godot users from using the engine. It's not easy to create workarounds. I think I presented interesting real world situations which hopefully motivate someone to investigate and fix the problem. Right now I cannot imagine making a game with the use of a tilemap and RigidBody2D objects, especially when using slopes. Grenades bounce back at player, movable objects get stuck on the floor... There are many situations where the bug can completely spoil the experience.
I am interested in this issue has there been any updates or possible leads?
still an issue in 4.2.2 would really love any sort of fix
If your level geometry is static, you probably want to pre-bake collisions to avoid this for now: https://github.com/godotengine/godot/issues/47148#issuecomment-1412983426
Should mention that the Rapier2D plugin doesn't have this issue, and seems to be on its way to become the overall better choice for 2D physics, like Jolt has become for 3D.
Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.
Godot version
4.0-stable
System information
Ubuntu 20.04.6
Issue description
A round RigidBody2D colliding near the junction of two squared tiles can result in wrong and inconsistent bounces. Typically, a RigidBody2D going strictly vertical can result in a bounce with some horizontal velocity.
Possible Related issues:
continuous_cd
values, but setting it tocast_ray
also induces a weird damping behavior (see also #76621).Workaround ideas
https://user-images.githubusercontent.com/51318484/235353411-87f2a443-1dcc-40c4-b582-f6c0f87a984a.mp4
Steps to reproduce
Create a Tilemap with squared tiles whose collision shapes are full squares. Create balls (RigidBody2D with round collision shape and a high enough bounce value) and place them above a tile junction, with a small horizontal offset. Run and watch the balls bouncing. The issue itself is inconsistent: it happens with specific physics parameters at specific positions. To reproduce it correctly, one has to play with those parameters.
Minimal reproduction project
ball-weird-bounce.zip