'RealityKit – AnchorEntity moves only to Origin

The problem is that it rise to origin... not just rotating itself.

video is youtu.be/hFafOjKN3rg

anchorEntity.anchoring = AnchoringComponent(anchor)
anchorEntity.addChild(modelEntityClone)
anchorEntity.addChild(downEntity)
anchorEntity.addChild(sideEntity)
anchorEntity.addChild(rightEntity)
anchorEntity.name = name
        
arView.scene.addAnchor(anchorEntity)
arView.scene.addAnchor(planeEntity)

DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
    print("after 3 sec")
            
    let radians = 90.0 * Float.pi / 180.0
            
    let currentMatrix = anchorEntity.transform.matrix
    let rotation = simd_float4x4(SCNMatrix4MakeRotation(90.0 * .pi/180, 0,1,0))
    let transform = simd_mul(currentMatrix, rotation)                
    anchorEntity.move(to: transform, relativeTo: nil, duration: 3.0)
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source