I Want to make an entity move. I have added an onTap function that now works and registers touches. But I can't seem to make the entity move. I copied this code from session 605
@IBAction func onTap(_ sender: UITapGestureRecognizer) {
let tapLocation = sender.location(in: arView)
print("I am here at onTap")
// Get the entity at the location we've tapped, if one exists
if let object = arView.entity(at: tapLocation) {
// For testing purposes, print the name of the tapped entity
print(object.name)
// Add interaction code here
var flipUpTransform = object.transform
flipUpTransform.rotation = simd_quatf(angle: .pi, axis: [1, 0, 0])
let flipUpController = object.move(to: flipUpTransform, relativeTo: object.parent, duration: 2.0, timingFunction: .easeInOut)
print("I think I just moved")
flipUpController.completionHandler {
// box is finished flipping
}
}
}