You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When clicking a physics body with input_ray_pickable == true and capture_input_on_drag == true and dragging, upon leaving the boundaries of this object, it stops receiving mouse input.
This is in contrast with how it worked in Godot 3.5, where you could click and drag the mouse wherever and body would still receive input events.
This complicates implementation of 3D dragging functionality, since it's very easy for mouse cursor to outpace the object, leave it's area, trigger mouse_exited signal and stop receiving any subsequent input.
Steps to reproduce
Download 2 minimal reproduction projects
Launch 3.5 version, click on a sphere and drag the cursor outside of it
Notice how in Output in never says that mouse exited the sphere unless you release the button
Launch 4.1 version, click on a sphere and drag the cursor outside of it
Notice how in Output there is a mouse exited message as soon as cursor leaves the sphere
The text was updated successfully, but these errors were encountered:
dreadpon
changed the title
Physics body stops receiving input dragging outside of it's physics shape with capture_input_on_drag enabled (disparity with Godot 3.5)
Physics body stops receiving input when dragging outside of it's physics shape with capture_input_on_drag enabled (disparity with Godot 3.5)
Sep 14, 2023
This got changed intentionally in #68007, so that the signals mouse_entered and mouse_exited now align with the area. The same has been done for Control nodes in #67791.
I believe, that there is a misunderstanding of input_capture_on_drag:
It has no longer any effect on the mouse_entered and mouse_exited signals. But when the flag is true, then the CollisionObject3D will still receive input events, when the mouse is dragged outside of the shape.
Yes, that works, thank you
The original project where I encountered this had a lot of logic built around mouse_entered and mouse_exited, so I wasn't successful in testing input_event signal
But in a reproduction project above it certainly works
And since CollisionShape3D also receives InputEventMouseButton.pressed == false events, I should use those instead, correct?
If yes, then this can be closed, I'll just have to restructure my code a bit
Godot version
4.1-stable
System information
Windows 10 4.1-stable Forward+
Issue description
When clicking a physics body with
input_ray_pickable == true
andcapture_input_on_drag == true
and dragging, upon leaving the boundaries of this object, it stops receiving mouse input.This is in contrast with how it worked in Godot 3.5, where you could click and drag the mouse wherever and body would still receive input events.
This complicates implementation of 3D dragging functionality, since it's very easy for mouse cursor to outpace the object, leave it's area, trigger
mouse_exited
signal and stop receiving any subsequent input.Steps to reproduce
Output
in never says that mouse exited the sphere unless you release the buttonOutput
there is a mouse exited message as soon as cursor leaves the sphereMinimal reproduction project
capture_on_drag_3.5.zip
capture_on_drag_4.1.zip
The text was updated successfully, but these errors were encountered: