The Untold Engine makes it easy to add animations to your models. This tutorial will walk you through setting up and playing animations for a rigged model.
Start by creating an entity for your animated model.
let redPlayer = createEntity()
Load the .usdc file for your rigged model and link it to the entity.
setEntityMesh(entityId: redPlayer, filename: "redplayer", withExtension: "usdc", flip: false)
Note: If your model renders with the wrong orientation, set the flip parameter to false.
Next, load the animation for your model. Provide the animation .usdc file and a name for the animation, which the engine will use as a reference.
setEntityAnimations(entityId: redPlayer, filename: "running", withExtension: "usdc", name: "running")
Set the animation to play by referencing its name.
changeAnimation(entityId: redPlayer, name: "running")
After you Run the project in Xcode:
- Your model should appear in the game window.
- Press P to enter Game Mode, and you’ll see your model animating.
Previous: Enabling Physics