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

mouse_entered/mouse_exited signals emitted for physics bodies even when hidden behind GUI overlay. #81287

Open
GlyphTheWolf opened this issue Sep 3, 2023 · 2 comments · May be fixed by #81291

Comments

@GlyphTheWolf
Copy link

Godot version

v4.1.beta2.official [a2575cb] and later up to 4.1.1 stable

System information

Windows 10.0.19045 - Vulkan (Compatibility) - NVIDIA GeForce GTX 1050 (NVIDIA; 31.0.15.3713) - Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz (4 Threads)

Issue description

My project use signals mouse_entered and mouse_exited of CollisionObject3D to show some custom tooltips for 3D objects player may interact with.

The issue is that with latest Godot version behavior of that signals has changed and now they are triggered for my 3D scene objects even when user is hovering over GUI overlay (that is Controls with mouse filter set to MOUSE_FILTER_STOP for background, my GUI windows are just Controls not popups or real Godot windows) and object is hidden behind. That cause tooltips for 3D objects are shown on my GUI windows what is of course not desired.

I think it is a bug/regression, because same thing was working fine on previous Godot versions and also I would expect old behavior based on input handling documentation which states that physics object picking is done as last step if not blocked by GUI (and some other possible processing) first.

From what I checked behavior has changed between:
v4.1.beta1.official [828ec2c] <- Here behavior is OK as I would expect
v4.1.beta2.official [a2575cb] <- From now on behavior is WRONG

Here you can see issue in my project (run with v4.1.1.stable.official [bd6af8e]):

tooltip_bug

Tooltip for "World Map" is displayed since world map object hidden under GUI overlay received mouse_entered signal even I believe it shouldn't in this case.

Steps to reproduce

In my minimal reproduction project there is red sphere in the middle as 3D object for picking and blue rectangle covering half of the viewport as overlay GUI. In the upper right corner there is debug label showing if the red sphere is hovered or not (simply based on mouse_entered/mouse_exited signals from CollisionObject3D).

Expected behaviour is that red spehere should be hovered only when mouse is outside of the blue rectangle (and hovering visible part of sphere of course).

You can try runnig this project on v4.1.beta1.official [828ec2c] and behavior is OK, but if you run the same project on v4.1.beta2.official [a2575cb] (or later up to 4.1.1 stable) you can see that the red spehere is getting hovered even when hovering its left part hidden under GUI rectangle.

Minimal reproduction project

OverlayGUIHoveringWithPhysicsPicking.zip

@Sauermann
Copy link
Contributor

Can confirm bug on Linux with

  • v4.1.beta2.official [a2575cb]
  • v4.2.dev.custom_build [fa3428f] (slightly different behavior, but still a bug)

@stokatyan
Copy link

stokatyan commented Jan 19, 2024

Possibly fixed in #87362

@KoBeWi KoBeWi removed this from the 4.3 milestone Aug 4, 2024
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