Reputation: 432
I am in the need to access, hide and modify scene content programmatically.
I do know that the content of a schene can be load via Model3D or RealityView (What is the difference between Model3D and RealityView in visionOS?)
I do know that I can modify the content at load time.
What I do not know is how to access the content on a later time, once it is loaded.
With scenekit or realitykit I can do that easily, how can I do that in visionOS?
Upvotes: 1
Views: 158
Reputation: 79
On VisionOS with RealityKit, you could hold a reference to the scene content
@State private var myContent: Entity?
Later when you load your content in RealityView:
RealityView { content in
if let scene = try await Entity(...) {
self.myContent = scene
// More setup...
}
}
With that you can access and modify any content via the myContent
object.
Upvotes: 0