Compose interactive 3D content in Reality Composer Pro -- Build Errors

In the example code provided in the tutorial the following error is thrown when attempting to store actions in an animation library on the root. Specifically when trying to add actions. Is there another way to do this? The example code provided does not compile.

Answered by brycelynch in 800143022

Fixed. Code was missing this: animationLibraryComponent.animations

if var animationLibraryComponent = entity.components[AnimationLibraryComponent.self] { // Add or modify animations directly in the animations dictionary animationLibraryComponent.animations["RobotReturnToHomeAction"] = robotTravelHomeActionResource animationLibraryComponent.animations["RobotTravelHomeCompleteAction"] = robotTravelHomeCompleteActionResource entity.components[AnimationLibraryComponent.self] = animationLibraryComponent }

Accepted Answer

Fixed. Code was missing this: animationLibraryComponent.animations

if var animationLibraryComponent = entity.components[AnimationLibraryComponent.self] { // Add or modify animations directly in the animations dictionary animationLibraryComponent.animations["RobotReturnToHomeAction"] = robotTravelHomeActionResource animationLibraryComponent.animations["RobotTravelHomeCompleteAction"] = robotTravelHomeCompleteActionResource entity.components[AnimationLibraryComponent.self] = animationLibraryComponent }

Compose interactive 3D content in Reality Composer Pro -- Build Errors
 
 
Q