3

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?

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
Ahmad Mustafa
  • 521
  • 1
  • 3
  • 12

1 Answers1

1

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))
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220