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 mouse_entered/mouse_exited doesn't update properly with Camera2D movement #75711

Closed
paul-deva opened this issue Apr 5, 2023 · 5 comments · Fixed by #78017
Closed

Area2D mouse_entered/mouse_exited doesn't update properly with Camera2D movement #75711

paul-deva opened this issue Apr 5, 2023 · 5 comments · Fixed by #78017

Comments

@paul-deva
Copy link

Godot version

v4.0.2.stable.official [7a0977c]

System information

Windows 10, Linux

Issue description

When the mouse_entered and mouse_exited signals are used with an Area2D node, the signals are not emitted if the Camera2D moves the viewport such that the mouse enters or leaves the area.

area

Steps to reproduce

Open the attached minimal project...

  1. Put the mouse cursor inside the circular area
  2. Move the camera with WASD or arrow keys such that the mouse cursor enters and leaves the area (don't move the mouse in this step)
  3. Watch as the label doesn't update properly

Minimal reproduction project

Area2D bug.zip

@Sauermann
Copy link
Contributor

A few weeks ago, @RandomShaper and I have discussed this issue and came to the conclusion, that this should be considered a bug and be solved.

@paul-deva
Copy link
Author

A few weeks ago, @RandomShaper and I have discussed this issue and came to the conclusion, that this should be considered a bug and be solved.

I haven't found a similar issue when searching the git so I decided to open up this one. It might be good to check if other types of nodes have the same bug, like Control nodes and Area3D.

@paul-deva paul-deva reopened this Apr 6, 2023
@Sauermann
Copy link
Contributor

The discussion happened on RockenChat, so it is good to have this Issue open as a reminder. And both other nodetypes, that you mentioned, show the same behavior.

@Dritic
Copy link

Dritic commented Jun 8, 2023

Would love to see a fix for this implemented! I've also noticed that it's an issue if you want to use mouse_entered/mouse_exited signals on control nodes that have their positions updated (for example: making UI appear/disappear using an AnimationPlayer).

@Sauermann
Copy link
Contributor

@Dritic The issue about Control nodes is more complex and will have to wait until Viewport::update_mouse_cursor_state no longer creates InputEvents.

@akien-mga akien-mga added this to the 4.1 milestone Jun 9, 2023
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.

5 participants