However, when I build a project with a canvas and any UI element as child, I’ll get a fatal error when Xcode tries to launch the app in simulator:
[Platform] Entity -2147483648:19091238 not found
PolySpatialRealityKit/PolySpatialImplUtils.swift:52: Fatal error: Entity -2147483648:19091238 not found
As soon as I remove the child object, the same app without any additional changes will launch as expected.
I have the same issue in our existing project we’re porting to visionOS.
Are there any additional settings to be aware of regarding UI and PolySpatial?
I’ve never seen this error at all, not even with way more complex canvas hierarchies than what you are describing. Can you post a simple sample repro that I can look at?
I tried to create a sample project for you today, but I didn’t manage to reproduce the error a clean Project. Even my test project didn’t threw the Error. I worked on another machine though and might have uncommited changes at the office.
I was able to reproduce the error in our game though, seems like there is a combination of stuff that leads to this. I’ll keep digging into since we really want to use the canvas.
I spent a few more hours debugging this. I noticed that a scene that works perfectly in a clean project, doesn’t in our game. So I started comparing the project settings, but still no luck after making sure they are the same.
What I found out however, is that the fatal error occurs as soon as e.g. an Image component is attached to a game object. Removing it will let the project start in simulator, no fatal error thrown.
Similar behaviour on a default button. Removing the image and TMP-Text child will let the project start without any errors.
Is there something that comes onto your mind that could cause this issue @joejo? The game was ported from 2021.3.30 to 2022.3.11(now 12) when we started working on the visionOS port.
Well, buttons and TMP don’t have Image components on them AFAIK. Buttons get their image from an assigned image in the Button component and TMP only uses the font atlas image. Neither of these have been issues that I am aware of, at least not like this.
If what you are talking about is the assigned images then I am wondering if it has something to do with the images/textures that you are using?
We tracked it down to the Raycast Target setting on the image component. As soon as we set it to false, the project will launch as expected. Setting in back to true will lead to the fatal error during the start process. In out test case we are using only default Unity components, no sprites or anything.
I can reproduce this with the Raycast Target setting on a TMP-Text as well.
Can you tell us what happens at PolySpatialRealityKit/PolySpatialImplUtils.swift:52 so we can further investigate what the difference between our and other projects is?
And just to add more info, we use Raycast Target enabled for the samples and other projects and have not seen this, though this is definitely good information.
Hey there. I’m working with KevHell on our project for visionOS. I have picked this up again today, hoping the issue will go away in PolySpatial 0.6.2, but sadly it’s still there. I made a screengrab of the stacktrace in Xcode. Maybe this helps. If there is any other, better, way to export the stacktrace from Xcode, do let me know!
Well what that is telling me is that the RK side is failing to find an entity in the RK scene graph that the sim side thinks exists. Unfortunately there isn’t much more I can tell you without some sort of repro I can work with.
Are there any scripts on your objects or running in the background that could be altering game object activation or creation?
@mml and I reduced our project to a single scene, threw out all game related stuff and reproduced the bug in a project you can find here.
The project should start without any problems. If you set Raycast Target to true on the image (as shown below), Xcode will throw the fatal error while starting the app.
We’re using Unity 2022.3.12f1 and PolySpatial 0.6.2 and can reproduce this reliably.
So I haven’t run this yet, but the first thing I notice is that your project is using an out of date version of com.unity.xr.visionos. You should upgrade that package to the same version as the polyspatial packages.