UGUI Interaction Issues with PolySpatial When Animating

Hello!

I’ve built an animated UI using UGUI for a visionOS project and encountered issues when animating object positions. After animation, UI elements no longer function correctly.

Issues:

  • Collider/Hitbox Misalignment: The collider does not update in most cases. Often, I can still interact with the button at its original position rather than its animated location.
  • Inconsistent Button Interaction: When clicking a button, I see the interaction color applied, but the button does not respond immediately. It often requires multiple clicks to trigger an action.

Additional Details:

  • Canvas: World Space
  • Canvas Camera: Assigned
  • Unity Versions Tested: 6000.0.29f, 32f, 34f
  • PolySpatial Versions Tested: 2.0.4, 2.1.2
  • When switching from PolySpatial to Metal or testing in a non-visionOS project, the UI works correctly. This confirms that the issue is specific to PolySpatial.

Additional Notes:

Since I cannot share videos as a new user, I replicated the issue using the PolySpatial UGUI sample scene. At runtime, if you move a button out of the list and reposition it elsewhere on the screen, it fails to respond correctly.

Any insights or workarounds would be greatly appreciated. Thank you!

Hi, I’m sorry that you are having an issue. I’ve tried reproducing this issue given your description but I’ve been unable to. From the PolySpatial UGUI scene that you modified, could you file a bug and then reply here with the case number (IN-XXXXXX)? That way I can see your repro project and work with it directly.

1 Like

Hi @joejo,

Thank you for responding. I have created an example project and submitted it via a bug report. Case number is: CASE IN-93399

Thank you!

Ok, so I pulled down the project you attached with the bug. After deleting temporary, non-essential files (sln, csproj, Library, etc. so as to start with a clean slate) I opened your project in 6000.0.34f. I verified that the project was using released 2.1.2 PSL, was targeting PolySpatial and that I was using the right scene.

I built out and tested to both visionOS Simulator 2.0 as well as visionOS Device 2.2. In both cases, your scene acted as expected with no issues. I clicked the button, it moved as expected and only clicking the button would work. I.e., the hit box moved with the button as expected.

Is there anything else that you can suggest or think of that might be a trigger for reproducing your issue?

Interesting - so every click is recognized correctly? It fails a lot for me as described above. In fact, this isn’t my original project but a completely new project (it fails in the original project too). It’s only when I disable PolySpatial that it works correctly.

I did not test visionOS Simulator (we rarely use it for technical reasons) but I receive the same results on device.

Other details:
macOS 15.1.1
iMac 24-inch M1

In the meantime I had to build a work-around that’s a custom view manager that uses box colliders for buttons and that works flawlessly but I would love to return to button components.

Interesting - so every click is recognized correctly? It fails a lot for me as described above. In fact, this isn’t my original project but a completely new project (it fails in the original project too). It’s only when I disable PolySpatial that it works correctly.

Every time I tried it. I didn’t do it for very long (maybe 10 clicks). You’re bug and post here made it sound like it was immediate and all the time so I didn’t go very long.

Sorry that I couldn’t repro this, but it’s good that you have a workaround to unblock you.

It’s working but it would be great if the UI worked as intended. I’ve shared this sample project with other members of my team. I’ll report back when I have their results.

@joejo

A colleague tested the same project and he’s experiencing the same issues. When you click, is the button moving position every single time and you’re seeing debug messages for start and stop?

Note that I do see the button change color but it does not always trigger the event.

When I click the button, the button moved one side to the other. When I click the button in the new location, it then moves back. There seems no issue with the hit box that makes it so that this doesn’t happen.

I didn’t check logs as that wasn’t part of the repro/issues from the bug:


Collider/Hitbox Misalignment: The collider does not update in most cases.  Often, I can still interact with the button at its original position rather than its animated location.

Inconsistent Button Interaction: When clicking a button, I see the interaction color applied, but the button does not respond immediately.   It often requires multiple clicks to trigger an action.```

I don't see either of these.

@joejo

I’ve had another colleague test the same project and they indeed have the same issues. Is it possible something is different on your machine? Can you please have other Unity folks test?

Thanks!

Sure. Also, for reference I am on:

macOS 15.2
MacBook Pro 14" M1-Max
Xcode 16.2, visionOS 2.0 Simulator, visionOS 2.1 Simulator
Apple VisionPro, visionOS 2.2

Unfortunately, no one here can seem to repro your issue. I’m not sure at this point how to proceed as I’m not sure what the diffs are that would make this work here and not there.

For the repro sample, there should be no issue with testing that in simulator. Have you tried that?

Are you by any chance using the VisionOSBillboard component?
It causes problems with the UGUI. Had me struggling with UI for a long time.

https://discussions.unity.com/t/bugreport-in-87365-billboard-component-prevents-from-manipulating-ugui-when-billboard-becomes-horizontally-flat/1542044

hey @jwalters_nexus

I have been looking into this issue and as Joejo mentioned we cannot reproduce your issue.

A couple of questions so we can try to reproduce this as close as your setup is:

  • Where are you testing this, on the simulator, on device? (we couldnt reproduce this with either)
  • What type of camera are you using in your specific scene, bounded?, unbounded?
  • Are you using Reality Kit or Metal
  • Are you running this as a build or through the play to device feature.
  • From the project you attached it seems you have not disabled the splash screen, can you try disabling it?
  • Do you get any issues / warnings in the project validation window?

I have tested this on
macOS 15.2
MacBook Pro M1-Max
Xcode 16.2, visionOS 2.0 Simulator, visionOS 2.1 Simulator
Apple VisionPro, visionOS 2.2

Hi @jmunozarUTech

Appreciate the replies!

  • This issue occurs in Unity-editor and device (we do not use simulator).
  • Bounded volume
  • Reality Kit w/ PolySpatial is when the issue occurs. Selecting Metal and of course no-visionOS and it works correctly.
  • Always as a build, never with play-to-device (it’s too slow with our work).
  • Splash Screen is disabled in our actual project and there is no difference.
  • No issues / warnings in the project validation window.

I am testing on:
macOS 15.1.1
iMac 24" M1
Xcode 16.0
Apple VisionsPro, visionOS 2.2
Unity Engine 6000.0.29f

Please note my colleagues tried the sample project also and experience the same issues.

@MirCore we are not using the VisionOSBillboard but thank you for the tip!

Hmm in my main project, I notice that if I do not scale the canvas and instead scale down the child objects root, the interaction is much better. It’s still faulty at times, where is does not always respond to clicks (even though it highlights) but this is better. If I detect anything else I’ll share here.

thanks for getting back to us – can you ellaborate more about the scale? – can you set the scale to 1 on everything and see how it behaves?

With my previous test it was working great on device until I re-positioned things. It seems that the localScale, if not 1x1x1, will cause issues with PolySpatial. I’ve now set my new UI to be completely 1x1x1 and so far it seems correct. It just means I need to design in tiny units vs a non-worldspace UI (where my scale is always 1x1x1), which is a non-issue if it’s working.

That said, I’m still unclear as to how my test project functions correctly on every single mouse click for you.

Thanks!

1 Like

Was your scale non-uniform by chance?