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

area_entered and area_exited emitted multiple times while still overlapping #35595

Closed
Tracked by #45333
shafy opened this issue Jan 26, 2020 · 14 comments
Closed
Tracked by #45333

Comments

@shafy
Copy link

shafy commented Jan 26, 2020

Godot version:
3.2rc1

OS/device including version:
MacOS 10.14.3 (Mojave) build running on Oculus Quest.

Issue description:
area_entered and area_exited signals are emitted all the time when one area is moved even though areas are still overlapping (for 3D). This only happens when the CollisionShapes are sufficiently small.

Steps to reproduce:

  • Create two Spatial Areas with small CollisionsShapes (e.g. Extents (0.015, 0.009, 0.015))
  • Overlap them and move one area slightly. Check for area_entered which is emitted even though the areas never stop overlapping.
  • Try the same with bigger CollisionShapes and it works as expected

Minimum reproduction project:
Not sure how much it helps since you need a Quest to run it: https://github.com/shafy/blocks-kosmos-school/

Grab one of the blocks on the table and hold one of the small six Areas into another block's to see what I mean.

@Calinou
Copy link
Member

Calinou commented Jan 26, 2020

Please upload a minimal reproduction project to make this easier to troubleshoot. Thanks in advance 🙂

@shafy
Copy link
Author

shafy commented Jan 26, 2020

Thanks @Calinou, I updated the comment. Not sure how much it will help since it's a Quest app :-)

@creikey
Copy link
Contributor

creikey commented Jan 27, 2020

When collisionshapes are especially small the physics engine ( bullet ) will start to have problems unless you adjust the margin property of the collision shape.

@shafy
Copy link
Author

shafy commented Feb 24, 2020

You mean I need to increase the margin?

@creikey
Copy link
Contributor

creikey commented Feb 25, 2020

@shafy yes

@shafy
Copy link
Author

shafy commented Mar 10, 2020

Ok, but this is then the same as just increasing the volume of the collision shape. So it doesn't really solve the problem then. But I guess there's nothing we can do about it if it's beause of Bullet?

@pouleyKetchoupp
Copy link
Contributor

Does it work as expected if you switch the physics engine to Godot Physics?
Project Settings > Physics > 3D > Physics Engine > Godot Physics

@shafy
Copy link
Author

shafy commented Jan 16, 2021

Thanks @pouleyKetchoupp. I'm currently not working on that project anymore and so won't be able to test this any time soon. But I'll let you know once I can. Or maybe someone else who has a similar problem can check it?

@pouleyKetchoupp
Copy link
Contributor

Alright. If anyone can reproduce a similar issue, please test with Godot Physics and share a minimal project to help investigate.

@SoapSpangledGames
Copy link

I don't have a minimal project, but my larger project exhibited similar behavior with Godot 3.2 and 3.3.2 official builds. In my case, area_exited fired twice for each object. My issue involves collisions with a small box [extents (0.507,0.532,0.612), margin 0.04] and a cylinder (radius 1, height 2, margin 0.04). This happens under Godot Physics and Bullet physics.

After struggling with this for days, I ended up making the cylinder longer (height 5.07). This fixed the problem for me under both physics engines.

@pouleyKetchoupp
Copy link
Contributor

@SoapSpangledGames Thanks for info! Would you be able to check if your issue still occurs in 3.4 beta by any chance?

@SoapSpangledGames
Copy link

SoapSpangledGames commented Sep 29, 2021

I am unable to reproduce my problem in 3.4 beta 5. I was mistaken about the signal I was using. I was using body_exited, not area_exited. But the issue was correct, and I'm unable to reproduce it now. It seems to be fixed in 3.4 beta 5.

@pouleyKetchoupp pouleyKetchoupp added this to the 3.4 milestone Sep 29, 2021
@pouleyKetchoupp
Copy link
Contributor

Closing for now since it seems fixed in 3.4.

@shafy Feel free to re-open if you can still reproduce the issue when you get to test this project again.

@Calinou
Copy link
Member

Calinou commented Mar 16, 2022

@jeudy-ua Please open a new issue with a minimal reproduction project attached.

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

5 participants