I created some attachments by following the Diorama Apple example. Things have been working fine. I wanted to add BillboardComponent
to my attachments. So I added it in this way
guard let attachmentEntity = attachments.entity(for: component.attachmentTag) else { return }
guard attachmentEntity.parent == nil else {return}
var billBoard = BillboardComponent()
billBoard.rotationAxis = [0,1,0]
attachmentEntity.components.set(billBoard)
content.add(attachmentEntity)
attachmentEntity.setPosition([0.0, 0.5, 0.0], relativeTo: entity)
My attachment view is like this
Text(name)
.matchedGeometryEffect(id: "Name", in: animation)
.font(titleFont)
Text(description)
.font(descriptionFont)
Button("Done") {
viewModel.arrows.remove(at: 0)
}
}
If I remove the BillboardComponent
then button click works fine. but with the `BillboardComponent button click doesn't work (not even highlighting when I look at it) in certain directions. How to resolve this issue?