I’ve been using Unity MARS for almost a year now and am at a loss as to how to get Occlusion working. I tried adding AR foundation’s Occlusion Manager to my MARS camera and set it up just like in a normal AR foundation setup, but its doesn’t seem to do anything. I’m also in URP. I would love to know what to do here, I feel like I’m missing something since there’s no other questions about this anywhere else
Hi - can you tell us which version of Unity and what versions of the AR Foundation packages you are using? And is this on Android or iOS?
I have also tried to get humanDepthTexture and humanStencilTexture on iOS, but I have had no success.
My setup:
- I created a sample MARS app with body tracking.
- I attached the AR Camera Manager and AR Occlusion Manager to the MARS Session > Main Camera.
- I attached another script that gets humanDepthTexture and humanStencilTexture in the Update() function and writes them to the log.
The problem:
Both humanDepthTexture and humanStencilTexture are null.
What I have tried:
- Adding an ARSession besides MARSSession. But it did not work.
If I do the same setup with a new project from the “AR Mobile” template, it return non-null result.
My environment:
- Unity Editor: 2022.3.18f1
- MARS: 1.5.0
- AR Foundation 5.1.1
- Tested device: iPhone 12
My question:
Is there anything I am doing wrong? Any help would be appreciated.
Thank you,
Some additional information.
- If I create a new project using the “Mobile AR” template, and attach a script that reads humanDepthTexture, this works fine.
- But If I add “Body Tracking” from the MARS Panel, humanDepthTexture now returns null.
- Disabling the “Proxy” script of the Body object does not resolve the issue.
- Removing the Body object resolves the issue and humanDepthTexture returns a non-null result.
So it looks like the existence of an object from MARS will disable humanDepthTexture.