People Occlusion: Sample Code

It's so weird but I am having compilation issues with this sample code in ViewController.swift:


1) Expression Type "AnchorEntity" is ambiguous without more context in line 24

2) Value of Type "ARView" has no member "Session" in line 45

(I checked the framework and don't see the Session either)


I tried the "BodyDetection" sample code and ARView does have session.

Anyone has these issues?

Accepted Reply

It is very likely that your build destination is currently set to a Simulator, and those symbols are not available in the Simulator. You want to make sure you set the destination to either Generic iOS Device, or to an actual device.

Replies

Yes, I meet the same problem, and there are 4 errors in total.


Use of undeclared type 'BodyTrackedEntity'

Value of type 'ARView' has no member 'session'

Type 'Entity' has no member 'loadBodyTrackedAsync

Value of type 'Any' has no member 'sink'


Do you have any idea about solving these problem?

It is very likely that your build destination is currently set to a Simulator, and those symbols are not available in the Simulator. You want to make sure you set the destination to either Generic iOS Device, or to an actual device.

Thank you! You are absolutely correct. The sample code for PeopleOcclusion has a default setting to iPhone XR while BodyDetection has a setting to Generic IOS Device.


Sheesh.... :-)