Hi, I create an entity and add a bunch of attachments (code is based on the Diorama demo). I can rotate the entity with this:
.gesture(
DragGesture()
.targetedToAnyEntity()
.onChanged { value in
let entity = value.entity
let orientation = Rotation3D(entity.orientation(relativeTo: nil))
let newOrientation: Rotation3D
if (value.location.x >= lastGestureValue) {
newOrientation = orientation.rotated(by: .init(angle: .degrees(0.5), axis: .y))
} else {
newOrientation = orientation.rotated(by: .init(angle: .degrees(-0.5), axis: .y))
}
entity.setOrientation(.init(newOrientation), relativeTo: nil)
lastGestureValue = value.location.x
}
)
But the attachments stay still. How can I rotate the entity AND the attachment at the same time?