Hi, I looked Diorama example, and I wanted to do the same.
Which is to have custom PointOfInterestComponent in the anchor object in Composer Pro. In the Scene, I iterates to find that tag with attachment( which I created when adding that scene), and each the attachment
update: { content, attachments in
viewModel.rootEntity?.scene?.performQuery(Self.runtimeQuery).forEach { entity in
guard let attachmentEntity = attachments.entity(for: component.attachmentTag) else { return }
guard let component = entity.components[PointOfInterestRuntimeComponent.self] else { return }
guard let attachmentEntity = attachments.entity(for: component.attachmentTag) else { return }
guard attachmentEntity.parent == nil else { return }
attachmentEntity.setPosition([0.0, 0.4, 0], relativeTo: entity)
entity.addChild(attachmentEntity, preservingWorldTransform: true)
}
This doesn't show attachment Entity, but if I do
content.addChild( attachmentEntity )
instead of entity.addChild, it shows up. What could be wrong?