How to use RealityKit Package Content in SceneKit
Explicitly declare the resources in the Package.swift file, import the module and use the code found below.
The following tutorial reveals code our upcoming app Object Capture Pro. If you wish to be updated on the progress and release of this app, please subscribe using the link below.
This tutorial assumes that you have successfully added a Reality Kit Content to an XCode project.
If you have not follow the tutorial below.
Step One: Update the Package
Update the Package.swift file within the Reality Kit Content package to explicitly allow the resources to be available.
This is done by adding a line similar to the one below for each of the files to the resources array found within the .target of the targets.
.process("PACKAGE_NAME.rkassets/FILE_NAME.FILE_EXTENSION")
If you are having issues with this step, please consult the tutorial below to learn how to debug the contents of a package.
For more information, consult the Apple Developer documentation linked below.
Step Two: Add to SceneKit
Using code similar to the one below, use your RealityKit Content within a SCNScene.
Step Three: Test
Run the code and confirm everything works.
Looking to learn more about SwiftUI, Swift, Swift Testing, Design and Technology?
Search our blog to learn more about Swift, SwiftUI, Swift Testing, design and technology.