-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Hello!
So ive tried to follow your tutorial here: https://blog.pusher.com/animating-3d-model-ar-arkit-mixamo/ and my code is identical to yours but im getting an error thrown at playAnimation(...) because the animations array is empty even though loadAnimations(...) is called. Any explanation? Im fairly new to Swift.
loadAnimation(withKey: "dancing", sceneName: "IdleFixed", animationIdentifier: "samba_danceFixed-1")
}
func loadAnimation(withKey: String, sceneName:String, animationIdentifier:String) {
let sceneURL = Bundle.main.url(forResource: sceneName, withExtension: "dae")
let sceneSource = SCNSceneSource(url: sceneURL!, options: nil)
if let animationObject = sceneSource?.entryWithIdentifier(animationIdentifier, withClass: CAAnimation.self) {
// The animation will only play once
animationObject.repeatCount = 1
// To create smooth transitions between animations
animationObject.fadeInDuration = CGFloat(1)
animationObject.fadeOutDuration = CGFloat(0.5)
// Store the animation for later use
animations[withKey] = animationObject
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels