Click on UGUI Buttons with background as child object

Hello guys, i’m trying to port my app to VisionOS and facing a problem with ugui button clicks.

Seems that Button/InputField/Toggle only accept clicks if we have a graphic or collider on same gameobject of the component.

If i put the graphic as a child of the button, on VisionPro Simulator, the click events doesn’t work.

My current setup is:

→ Button
→ BG (With Image (with RayCastTarget) + VisionOSHoverEffect + Collider)
→ Text

Setup that works (but will highlight whole hierarchy as seems that VisionOSHoverEffect highligh everything)

→ Button + Image (With RaycastTarget) + VisionOSHoverEffect
→ Text

Is there anyway to fix that issue? On other platforms when we receive a click on a graphic, the “UnityEngine.UI.Selectable” above will also trigger that event.

Best Regards
Rafael

Okey, seems that VisionOS on MixedRealityMode only accept click on Image/Rawimage components and on my case i’m trying to put a Graphic component that Inherit from Image/RawImage and seems that UIGraphicTracker will ignore inherited componenets aswell to generate collision meshs.

Yes; we only automatically generate colliders for Image and RawImage components (not derived classes) with raycastTarget set. You should be able to add an explicit Collider (BoxCollider, e.g.), though, to receive input. It can just be a trigger collider.

@AndrzejUnity If we have an GameObject with a Graphic (inherited from Image or RawImage) + Collider and we disable/enable the game object hierarchy PolySpatialCompondCollider will raise an exception on GetOrAddCollider() method

(seems that on DebugObject it will destroy the collider when disabled but it still referenced internally by the Dictionary)

Hmm, OK. I believe we have a fix for this ready for the next release, but @joejo should be able to confirm. If not, we’ll probably ask you to submit a repro case as a bug report.

I do believe we have an upcoming fix for that, but if you can provide me with a very stripped down project to test with I can verify.