Our existing iOS app uses the Localitation package for translating UI texts. This worked fine on iOS, but not on visionOS. The texts don’t reflect what’s set using the Localize String Event component.
Hi there! Thanks for reporting the issue, and sorry to hear you’re having trouble.
We’ve done some tests with localization on visionOS, so without more information it will be hard to track down the issue you’re running into. Can you submit a bug report with a Unity project that reproduces the issue? I know uploads to our bug reporter can be a little slow, so please feel free to use a secure file sharing service like Google Drive or Dropbox and share a link here or in a direct message to me.
Thanks again, and good luck!
Thanks for the fast response. Unfortunately, my project is pretty complex. For the localization, I basically used a “Text” component (which I now replaced with “TextMesh Pro UI” for visionOS) and set its “text” property via a LocalizeStringEvent component. This worked on iOS, but not on visionOS. Or is it maybe TextMesh Pro UI related?
Hi. I suspect it’s an addressables issue. Can you share the log file from the player?
Which log file do you mean exactly? Do you mean the Xcode logs?
The player log file Unity - Manual: Log files
Im not sure where it is on Vision OS, maybe the same as IOS?
Ok, will try to locate them. At least a addressables_content_state.bin
file is created for visionOS, and it has 3kb. So there must be some strings in it.
BTW: I tried to update Localization to 1.4.5 to check if this fixes the issue. But I noticed that my GameObject references to LocalizeStringEvent were broken after this upgrade. Downgrading to 1.4.4 fixed it.
Thats strange, theres nothing in 1.4.5 that should cause something like that to happen. Can you try 1.5.0-pre.5?
Its safe to use this pre version, the only preview part is the UI Toolkit integration.
It got even weirder, when I quit Unity and I re-opened it. All the LocalizeStringEvent scripts were missing again. So I updated back to 1.4.5, closed Unity and re-opened it. And the scripts were linked now. Seems as if some internal references get changed. Will try 1.5.
I also noted that a GameObject that I had converted into a Prefab re-appeared as both the prefab and the GameObject after restarting Unity.
And another phenomenon: If I run my dialogs in the Editor, all UI texts will be blanked out now, as if all addressable strings were empty.
Did you try rebuilding the addressables?
Losing script references sounds like the localization script guid is changing. Are you using a modified version of the package? Are you still able to create LocalizeStringEvents after this happens? What version are you upgrading from?
Hm… this could still mean it’s a PolySpatial issue. We include editor tooling to validate how things will look on device, so what you see in Game View is actually a replicated hierarchy, similar to what we do with RealityKit on visionOS. Could you let us know what version of PolySpatial you are using? I’m assuming 0.7.1 since this is a recent post, but if you are on an older version, it’s possible this is an issue with UI/Text that we’ve fixed in a later version.
If you aren’t able to provide a repro project, we’ll need to gather as much detail as we can to replicate the issue on our end. Anything will help, like:
- Full project package manifest
- Unity Editor version
- Xcode version used to build/simulate on visionOS
- MacOS version
- Rough description of scene hierarchy (seriously, you’d be surprised… )
I installed both versions via Package Manager. The upgrade was from 1.4.4 to 1.4.5. I now reset all my changes using git, because I noticed other weird effects as well. Lost a day of work, because I had to rework things, but I did not trust the files anymore. I think it was actually related to a change in my prefab structure. I had created a for an existing prefab (with the same name) after I deleted the original prefab. On my second attempt, I changed the structure of the first prefab directly.
That the texts were blanked was actually my bad. When migrating from UGUI texts to TMPro Texts, I used the “text” parameter in the “static parameters” section instead of the “dynamic string” section. I didn’t remember that there is a difference, and it’s also a bit counter-intuitive IMHO. After I changed this, the texts show up correctly. Could only test for English, since the simulator doesn’t seem to support other languages. At least I could not find an option to switch the UI language.
However, although my dialogs show up correctly now, they don’t receive any events yet. I set the event camera of the world-space canvas, but still no interaction possible. Only the buttons highlight if my mouse is over them, so the camera seems to recognize something.
I see the same effect in the Unity Editor, if the project is using visionOS as the target. In the Editor, this is caused by the PolySpatial package adding a PolySpatial layer and two sorting layers, PolySpatial and PolySpatialUI. I have not found out yet why this is blocking any interaction in the dialogs in the Editor (and maybe also in the Simulator?).
If I delete these layers and sorting layers, things return back to normal - until PolySpatial adds them again after I return from Play Mode.
Is this in the visionOS simulator? If so, that’s the RealityKit HoverEffectComponent doing its thing, not Unity event handling. If this is in the editor, are you using the InputSystemUIInputModule
, or legacy input? I can’t remember if the legacy module even works in visionOS player builds, but we configure its input the way we do for InputSystemUIInputModule
. In the case of InputSystemUIInputModule
, our UnityPlayModeInput
in PolySpatial will override its input actions to specifically disable mouse/touch input, and only configure it to respond to SpatialPointerDevice
input. If you’re using another input module like XRUIInputModule
, you may still be getting mouse input in the Editor, which would give a “false positive” for things like hover.
A visual hover effect, or lack of ability to receive events? A visual effect would actually be somewhat surprising to me, at least if it resembles what you’re seeing in the simulator. The normal hover transitions on UI graphics may still be firing in the Editor due to receiving actual mouse events, not our emulated SpatialPointerDevice
.
Yeah, we’re pretty aggressive about that because without these layers (at least AFAIK) UI sorting won’t work properly. When you say “return to normal,” do you mean you do see events coming through? To be honest, there are a lot of places where this can go wrong, so it will be tough to track down without a specific repro project/scene. I know I sound like a broken record here, but these issues are very context-specific.
Also, at the risk of being branded a pedant, could I ask you to pick this conversation up in your other thread (or a new one) about UI events? If you find that you’re still having localization-related issues, let’s keep that thread going here, but it will be easier to reference these issues if they are in separate threads.
Thanks for your patience; I’m sure we’ll get to the bottom of all this
It’s both in the visionOS simulator and the Editor. In the Editor, I don’t see the hover effect, though. So I guess that’s because the HoverEffectComponent is only being applied in the simulator.
Yes, I am using InputSystemUIInputModule
.
What can I do to make interactions work in the Editor again, then? Do I have to add SpatialPointerDevice
input? And will this also make the dialogs react in the simulator (where they’re non-responsive as well)?
And what is the recommended approach, if the same project shall be used for both mobile devices (iOS, Android) and visionOS?
The lack of events received.
Yes. If I remove these (sorting) layers by reverting the layers file using git, I can interact with the dialogs in the Editor again once I press Play. But as soon as I exit play mode, they are being re-added, so if I enter play mode a second time, the dialogs become unresponsive again.
Ok, will do. Didn’t see this additional thread.