How to install gestures for Reality Composer?

329 views Asked by At

enter image description here

I added USDZ with animation in the Reality Composer (.rcproject) After Load the scene and added to the review

I tried to install gestures like Rotate scale ... but won't work

let ganGes = gangnim?.gnagnumObject as? (Entity & HasCollision)
arView.installGestures([.rotation,.translation,.scale], for: ganGes!)

How can I install Gestures to Reality Composer?

1

There are 1 answers

0
Andy Jazz On

To implement RealityKit's translate, rotate and scale gestures, you also need to call generateCollisionShapes(recursive:) instance method to prepare a model's shape used for collision detection.

guard let ganGes = gangnim.gnagnumObject as? ModelEntity else { return }
ganGes.generateCollisionShapes(recursive: true)
arView.installGestures([.all], for: ganGes as (Entity & HasCollision))