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

Area2D's signals *_entered and *_exited do not fire predictably during movement dependent on speed and size. #43743

Open
Tracked by #45334
julsams opened this issue Nov 21, 2020 · 10 comments

Comments

@julsams
Copy link

julsams commented Nov 21, 2020

Godot version:
v3.2.3.stable.official

OS/device including version:
Windows 10 Home 64-bit (10.0 Build 19041)

Issue description:
Area2D's signals body_entered, body_exitedm, area_entered and area_exited do not fire predictably dependent on the size and speed of the objects involved.

Steps to reproduce:

  1. Create an Area2D segment that splits the viewing area.
  2. Create two RigidBody2D objects with a small circle as a child CollisionShape2D.
  3. Set their linear_velocity such that the two RigidBody2D objects move toward and pass through the segment.
  4. Increase the speed of one of them sufficiently and the signal will not fire anymore.
  5. Slowing down the object or increasing its size will cause the signal to fire again.

Minimal reproduction project:
enter_exit_non_detection.zip

@Calinou
Copy link
Member

Calinou commented Nov 21, 2020

This is yet another physics tunneling issue. Try increasing Physics Fps in the Project Settings.

@pouleyKetchoupp
Copy link
Contributor

Confirmed on 3.2.3 and 3.2.4 beta 5.

Increasing the physics FPS a lot can fix the problem, but it can slow the game down by making physics run too many times for one game frame.
Setting the rigid body to Continuous collision detection should help but it doesn't in this case, that needs to be investigated.

@djrain
Copy link

djrain commented Jun 22, 2021

The same issue exists for a KinematicBody2D moving quickly, is this expected?

I'm not familiar with the inner workings, but it seems like KinematicBody2D uses some kind of CCD by default. So in theory, shouldn't it be able to reliably trigger any Area2D it passes through?

@pouleyKetchoupp
Copy link
Contributor

@djrain It's probably expected, I don't think KinematicBody2D does proper CCD. But it should be added at least as an option.

@AttackButton
Copy link
Contributor

Any chance to implement the #69934 and #70160 for Area2D and Area3D? At least as an option on the editor (for performance reasons).

The problem at the moment is that area nodes only trigger the body_entered or area_entered signals 6 or 7 frames late.

I don't think changing the physics ticks is the best solution for this.

@Torguen
Copy link

Torguen commented Aug 27, 2023

Shouldn't this have a milestone 3.6?
I don't know, I see it as an important bug.

@Torguen
Copy link

Torguen commented Feb 6, 2024

Still in 3.6 beta 4

@laurajayoconnor
Copy link

laurajayoconnor commented Mar 21, 2024

This is yet another physics tunneling issue. Try increasing Physics Fps in the Project Settings.

This solved the issue for me by dramatically upping physics ticks per second to 1,000 and max physics steps per frame to 100. I'm not sure how these settings will affect slower machines but it has no obvious downside on mine.

Edit: I tested on my M1 Macbook which gets about 15% of the frames as my PC and it was still too slow detecting the mouse entering/exiting.

@Torguen
Copy link

Torguen commented Mar 21, 2024

I hope someone can solve it, I have it pending in my project and I have it marked as a pending bug although I applied a remedy I hope someone solves this.

https://discord.com/channels/212250894228652034/1114293117336690778

@Torguen
Copy link

Torguen commented Jun 10, 2024

Forgive my insistence but... I cry out to the gods so that some charitable soul can solve this.
I hope that Godot 3 support is not ended with the existence of this bug!

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

7 participants