When I launch my app, I do see my scene loaded but I'm not able to use the translate, rotate or scale gestures to manipulate the scene.
Would like some help to make this work?
class ViewController: UIViewController {
@IBOutlet var arView: ARView!
override func viewDidLoad() {
super.viewDidLoad()
// Load scene from .rcproject
let scene = try! Project.loadScene()
// Add scene to the AR view's scene
arView.scene.addAnchor(scene)
// Add collision detection to the scene
if let entity = scene.children.first as? Entity & HasCollision {
// Generate collision shape
entity.generateCollisionShapes(recursive: true)
// Create an anchor and add the entity as a child of the anchor
let anchor = AnchorEntity(world: [0, 0, 0])
anchor.addChild(entity)
// Add the anchor to the scene
arView.scene.addAnchor(anchor)
// Install rotation, scaling, and movement gestures for the entity
arView.installGestures([.rotation, .scale, .translation],
for: entity)
}
}
}