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

Collision between small Area2D's fails when using BVH #54898

Closed
Drakmyth opened this issue Nov 12, 2021 · 6 comments · Fixed by #55036
Closed

Collision between small Area2D's fails when using BVH #54898

Drakmyth opened this issue Nov 12, 2021 · 6 comments · Fixed by #55036

Comments

@Drakmyth
Copy link

Godot version

3.4.stable.official

System information

Windows 10, GeForce 980Ti, Driver 496.49, GLES3

Issue description

When a small Area2D (12x12 pixels) is positioned entirely within a slightly larger Area2D (16x16 pixels), the collision may not be detected. Making the smaller Area2D slightly bigger (1-2 pixels) on either axis allows the detection, but only in the axis that was extended.

This seems to be related to the physics/2d/use_bvh option. Disabling this option allows the collisions to be detected as expected.

Steps to reproduce

See README in reproduction project repo for reproduction explanation and sample controls.

Minimal reproduction project

https://github.com/Drakmyth/GodotCollisionTest

@lawnjelly
Copy link
Member

lawnjelly commented Nov 12, 2021

Possibly related to #54855.

@pouleyKetchoupp : I just debugged and the BVH is calling the collision callback correctly it seems (in the situation where it fails to change color) so it may a logic problem with the masks in the physics?

Likely related to #54108.

@timovervliet82
Copy link

Can confirm this issue in 3.4. My project uses collision layers. I randomly spawn area2d's of 16x16 pixels. These Area2Ds use a collision layer to detect if they spawn on the tile map collision or not. This no longer works unless I disable BVH

@pouleyKetchoupp
Copy link
Contributor

@timovervliet82 Could you please test with #54925 to check that it solves your issue as well? If it doesn't I'm interested in a minimal project to investigate.

@timovervliet82
Copy link

@pouleyKetchoupp
I ran into some issues building your branch , was unable to test but I've created a project for you to easily repro the issue (atleast in 3.4 stable).

@pouleyKetchoupp
Copy link
Contributor

@timovervliet82 Thank you! I can confirm your issue is also fixed with #54925.

@timovervliet82
Copy link

@pouleyKetchoupp Great! Thank you!

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

Successfully merging a pull request may close this issue.

6 participants