When I am loading a scene in Unity I am creating these cards that you can select from. I am creating an array of these cards that I am instantiating in the Start() function of my script. When I run the application in the Game tab the cards spawn normally and I can interact with them using the XRI Interactions Toolkit. However once I build the application to the headset every GameObject that is declared before run time spawns correctly but the only GameObjects that do not are those Instantiated ones.
What would cause Magic Leap not render these GameObjects?
Unity Editor version: 6000.0.23f1
ML2 OS version: 1.12.0
Unity SDK version: 2.6.0
Host OS: Windows 10
I’m not sure I understand. The XRI interactions don’t work correctly if the object is instantiated ?
I found out what the issue is. In the magic leap headset it cannot see the files I am trying to load in my script.
How do I load files that are in my unity project also in the headset?
Could you provide reproduction steps? When I instantiate a cube in my project it works.
So it has nothing to do with instantiation. It has to do with the scripts that spawn the objects have errors. Right now in unity I am loading files from the project in /Assets/DataFiles/… to get data in to instantiate objects but in magic leap I am getting the error
DirectoryNotFoundException: Could not find a part of the path ‘/Assets/DataFiles’.
This is when I run the application on the headset and see the sonsole using adb on the connected computer.
This sounds like this is a generic Unity Android issue. Since this forum is reserved for Magic Leap 2 specific questions, I recommend reaching out on Unity’s official discussion forum. Loading objects from a path is the same on Android as it is on Magic Leap 2.
Based on your issue, I recommend looking into using this as the base path, if you are loading objects that are being referenced by path instead of Game Object.