How to installGestures on Reality Composer

Viewed 327

is there a way to add installGestures in reality composer?

i am able to do it in code, but i don`t want to mix too much code and ui parts. so i am searching how i can do the drag and drop part in reality composer.

here is the code snipit to do it in code and what i did so far.

arView.installGestures([.translation], for: modelEntity)

does anyone know how to enable this in reality composer?

thanks

2 Answers

I solved it with your hin now like this:

let startScene = try! RCProjectFile.loadStartScene()
if let cube = startScene.cube {
    if let cube = cube as? Entity & HasCollision {
        cube.generateCollisionShapes(recursive: true)
        arView.installGestures(for: cube)
    }
}

Reality Composer 1.5 allows you implement gestures only for running animated behaviours. At the moment there's no way to turn on Tap, Rotation or Pinch gestures in Reality Composer. Only via RealityKit, as you indicated.

arView.installGestures([.all], for: entity)
Related