how do I instantiate content in RealityKit

Asked on 09/06/2024

1 search

To instantiate content in RealityKit, you can follow these steps as outlined in the session "Explore object tracking for visionOS":

  1. Create a New Xcode Project: Start by creating a new Xcode project using the VisionOS app template. This will automatically create a default scene.

  2. Use Reality Composer Pro: Open the default scene in Reality Composer Pro. You can delete the default sphere and create an empty transform entity. Add an anchoring component to this entity, which will serve as the container for your object anchor.

  3. Object Tracking: Introduce a new target named object for object tracking. Import the reference object generated with CreateML and associate it with your anchoring component.

  4. RealityKit APIs: While Reality Composer Pro is used in this example, you can also use RealityKit APIs to create your anchoring component at runtime.

For more detailed guidance, you can refer to the session Explore object tracking for visionOS (09:38).