-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KinematicBody2D using move_and_collide makes other colliding KinematicBody2D move #21560
Comments
I can verify this as well, using Win10 64-bit with version 3.1 alpha c320d93. Here is a 3.1 version of the above example project. (Seems compatible as far as I can tell.) |
The project is using the default safe margin which is too high for this kind of interaction, all the bodies try to separate after move, making it move to the sides, reduce the safe margin to the minimum: |
@eon-s That seems to solve it. That is quite a small margin value though. X) |
On faster motions you can use higher margin (like on platformer demos), but if you want this kind of behavior, you must use a really low one. |
Even setting it to If the current approach with collision detection doesn't allow to completely solve this issue, I'd like to choose whether to enable the "try to separate" behaviour when I move a body. Could this be implemented in a convenient way? |
It may still happens at very small motions, I do not know if there is a better option than |
That's not accurate enough, The only method I can think of is Physics2DDirectSpaceState's |
This is likely resolved in the physics nodes reorganization for 4.0, closing. |
Godot version:
Godot 3.0.6 and custom build 12290c1
OS/device including version:
Windows 10 64 bit
Issue description:
When a KinematicBody2D collides with another KinematicBody2D, they make each othe move if their movement is not parallel.
Reducing the safe margin mitigates the problem but doesn't completely solve it.
Here the object to the left performs
move_and_collide(Vector2(15 * delta, 0))
and the one the rightmove_and_collide(Vector2(0, 0))
inside _physics_process. Safe margin is default 0.08.Probably related to #18433
Minimal reproduction project:
move_and_collide_test.zip
The text was updated successfully, but these errors were encountered: