GodotVR / godot-xr-tools

Support scenes for AR and VR in Godot
MIT License
504 stars 74 forks source link

Viewport_2d_in_3d mouse_entered and mouse_exited events not working reliably #623

Open Alessioforlante opened 6 months ago

Alessioforlante commented 6 months ago

I'm trying to create a button highlight effect using TextureButtons. I do this by changing the object's texture via code on events "mouse_entered()" and "mouse_exited()". When testing in 2D mode the button behaves as expected. In VR, however, it doesn't seem to work correctly: It looks like I need to "click" on the 2d_in_3d viewport (not the button itself!) to have it function If I click outside of the viewport, it doesn't work anymore. Also, when it does work, it works for a couple of seconds. after that, it stops working unless I click again.

I'm led to believe this is due to some optimization, where certain things are only checked within a period after a click - but this breaks that particular event.

I can't seem to find an option in the Viewport2Din3D object to change this behaviour. Please let me know if there is a way.