-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 2d not detecting fast mouse movement #43474
Comments
Please add a MRP, also, is it possible that you're somehow moving the mouse so fast that the position of the mouse is never IN the area? If this is indeed the problem and not something else causing it, there's a workaround you can do. make a RayCast that intersects Areas, and make sure it only raycasts with The area you need, and that others are excluded, and every time your mouse is moved, get the position of the mouse before and after, and use that as raycast start and end points, and that way use RayCast to get if the Mouse passed The Area. |
Will try to do the MRP as soon as possible...most probably upcoming weekend. I don't think i am moving mouse that fast as you described. I would say its just a fast move, similar to moves that we are doing all the time playing FPS games :)(or maybe I am superhuman haha). Like I say I will try to upload example asap and I will keep in mind your workaround with RayCast. |
I think this is just yet another case of physics tunnelling. You need to perform continuous collision detection yourself (by performing checks on positions between the previous position and the current mouse position) to avoid that. |
I'm closing this ticket since #43743 describes a similar issue with a MRP. |
Might be related to:
Fixed Area2d input events ignoring the top and left edge of rectangle shape #26103
Godot version:
Godot 3.2.3
OS/device including version:
Windows 7 and 10, both GLES2 and GLES 3
Issue description:
The issue is with two areas2d next to each other, they are not overlapping, there is even a 20 pixels gap between them, and the problem is that when you are moving your mouse fast from one area to another the mouse_entered signal is not working. I am using this areas to detect if mouse is over specific UI element on which i canoot set mouse filter to pass or stop(it need to be on ignore).
Steps to reproduce:
Create root node(node, node2d or control node) and as it childs add two UI panels one next to another, set mouse filter to pass or stop on both of them. Then for each panel create area2d with collision shape as a child. Set collision shape to rectangle and match the size with panel size. For both areas2d connect mouse_entered and mouse_exited signals to root node. Create variable mouse_over_UI in root node(bool) set it to false. The mouse_entered signal from each of areas2d should set this variable to true and mouse_exited to false. Remember to leave some gap(10-20 pixels) between areas/panels. Print mouse_over_UI variable in proces function to see the output/debug. Now to reproduce issue move mouse quickly from one panel to another and stop for a while, then move it very quick back to previous panel, repeat few times(remember that mouse need to be moved really fast to reproduce this bug) . As you can see while fast mouse moving, areas wont detect mouse entered sometimes which will give us console printing false while the mouse is over area2d.
Minimal reproduction project:
The text was updated successfully, but these errors were encountered: