@Vision Pro Engineer thanks for this, it helped a lot! For me and maybe it's because I was using a primitive from Reality Composer Pro, my entity's structure was a bit different:
⟐ SynchronizationComponent
⟐ CollisionComponent
⟐ InputTargetComponent
⟐ Transform
▿ 'usdPrimitiveAxis' : ModelEntity
⟐ SynchronizationComponent
⟐ ModelComponent
⟐ Transform
So to get the model component I would have used:
var model = cube.children.first?.components[ModelComponent.self]
or also use this to get the index:
let index = cube.children.firstIndex(where: { $0.name == "usdPrimitiveAxis"})
and then use that to get the reference from the children set
Topic:
Graphics & Games
SubTopic:
RealityKit
Tags: