Occlusion of virtual objects behind physical wall (AR/XR)

Hi,

I am trying to achieve an occlusion effect when placing a virtual object behind a physical wall. In order to do so, I located a virtual object 10 meters behind a physical wall which was 1 meter away, and in between the camera and the virtual object. Unfortutallty, the virtual object appeared in front of the physical object and was not hidden behind the wall. How can I achieve an occlusion effect and have the virtual object in the right place?

Thanks

We actkually have a sample which does exactly this:

https://github.com/Unity-Technologies/arfoundation-samples#simpleocclusion

But please ensure that the device supports depth. :slight_smile:

Thank you for your response. How can I find which devices support depth? Does it mean only devices with Lidar?

Yes, on iOS, environment depth occlusion is only supported on devices with LiDAR.
But on Android, this is supported without the LiDAR, all supported devices are marked with ‘Supports Depth API’: