Hello, I am developing an MR (Mixed Reality) game.
I want to disable the hover effect that appears when buttons or toggles are hovered over due to eye tracking. How can I disable hover effects?
If it’s not possible to disable hover effects, I’m curious if there’s a way to deactivate eye tracking in an MR environment.
Unity Version : 2022.3.20f1
VisionOS Version : 1.1.6
Thank you for your response. The hover effect I want to remove is not the hover effect set on the button itself, but rather the opaque gray hover effect that appears when images set as the Target Graphic of buttons or toggles are hovered over due to eye tracking. (This effect is not something I explicitly set.)
If there is an image component as a child object of a button or toggle, even if you set the Raycast Target of that image to false, the hover effect will still be displayed.
Currently, the only way to disable the hover effect is to disable Raycast Target on the Image component on the same GameObject as the Button/Toggle/etc. component (and making sure it doesn’t have a Collider of any kind). However, that will also prevent the button from being clicked, although you might be able to work around that by adding a backdrop with a Collider as a separate GameObject. You could also just disable the Button component.
If disabling Raycast Target that way doesn’t work for you, please submit a bug report with a repro case and let us know the incident number (IN-#####) so that we can investigate. I think we can change the behavior in a future release so that the hover effect doesn’t happen when the Button/etc. is not Interactable; I will make a note to do that.
Since visionOS 2.0 is adding the ability to customize the hover effect via a shader graph node, we’re going to be changing the way that hover effects work (via Packages/PolySpatiall/Resources/Shaders/MaskingShader.shadergraph) in PolySpatial 2.X to better match Unity’s hover behavior. Rather than the generic hover effect provided by visionOS 1.0 (which can be hard to see and can make transparent parts of images semi-opaque), we’re going to be supporting the Color Tint transition type as it works in UGUI. However, having the hover effect in the shader graph like that also means that you’ll be able to use a custom version of it in your UI elements and enable/disable the hover effect through material properties (or just set the hover color to the same as the normal one), which should help your use case.