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.
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.
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.
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.
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?
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?
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.
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.