I made a scene with Reality Composer, and trying to animate my entity using move(to:relativeTo:duration:timingFunction:)
When I call move(to:) the entity moves instantly not observing the duration I specify.
Here is my code handling SceneEvent.Update and when the entity comes down below 1m, I want to rotate(roll) the entity by 30 degrees.
let updateFeed = arView.scene.subscribe(to: SceneEvents.Update.self) { event in
if let a359 = self.sceneAnchor.findEntity(named: "A359") {
if a359.transform.translation.y < 1 && 0.9 < a359.transform.translation.y && self.animList.count < 1 {
// animation setup
let rightRoll = Transform(pitch: 0, yaw: 0, roll: Float(30).radian)
let rightRollAnimation = a359.move(to: rightRoll, relativeTo: a359, duration: 2, timingFunction: .easeOut)
rightRollAnimation.completionHandler {
self.animList.removeAll()
}
self.animList.append(rightRollAnimation)
}
}
}
I change duration from 2 to 2000, but no change, moves(rotates) instantly.