Skip to content
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 move_and_collide() fails to report collision in the case of very small safety margin #50287

Closed
tomsaram opened this issue Jul 8, 2021 · 3 comments

Comments

@tomsaram
Copy link

tomsaram commented Jul 8, 2021

Godot version

3.3.2.stable

System information

Windows 10

Issue description

The move_to_collide() returns a null value, even though the moving object clearly interacts with the static object. This is triggered when two conditions are met:

  1. The moving object has a small safety margin.
  2. The moving object starts overlapping with the static object, with a small depth.

Steps to reproduce

Open the reproduction project and run the scene. The moving object attempts to move downwards but is blocked by the static object.

The expected behavior is for the moving object to report a collision on the first _physics_process(), but instead, it does not report collision until the second _physics_process(), even though judging by the change of position, the object is clearly blocked from the start.

Changing the safety margin to a bigger value or starting from a larger depth (e.g. y = 256.05 instead of 256.02) makes this phenomenon disappear.

Minimal reproduction project

collision_bug_example.zip

@Calinou Calinou changed the title move_to_collide() fails to report collision in the case of very small safety margin KinematicBody2D move_and_collide() fails to report collision in the case of very small safety margin Jul 8, 2021
@Calinou
Copy link
Member

Calinou commented Jul 8, 2021

Can you reproduce this after increasing Physics Fps in the project settings to a higher value (like 120 or 180)?

@tomsaram
Copy link
Author

tomsaram commented Jul 8, 2021

Can you reproduce this after increasing Physics Fps in the project settings to a higher value (like 120 or 180)?

@Calinou I increased it to 200 and the bug can still be reproduced.

@pouleyKetchoupp
Copy link
Contributor

Fixed in 4.0, probably in #52953.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants