Skeletal Animation
Play bone-based character animations.
Introduction
Play bone-based character animations. This page provides a complete guide to skeletal animation in Appley, covering everything from setup to advanced techniques.
Animation is a core area of Appley. Understanding skeletal animation will help you build better games and use the platform more effectively. This documentation is designed for advanced level users.
Requirements
Before working with skeletal animation, ensure you have the following:
- Animated 3D models (FBX with animation data)
- An Appley project with characters
- Understanding of skeletal animation concepts
- Animation clips or timeline data
Estimated Completion Time
Step-by-Step Guide
Follow these steps to work with skeletal animation in your Appley project:
Import animated model
Import your FBX or GLB file that contains animation data for skeletal animation.
Load animation clips
In the inspector, load the animation clips from the imported file.
Set up the animator
Configure the animation state machine with states and transitions.
Script playback
Use the animation API to play, blend, and transition between clips.
Test and refine
Play the game and verify animations. Adjust blend times and transitions.
FluxScript Example
Below is an Appley Scripting (Flux Scripting) code example demonstrating skeletal animation:
// Animation — Skeletal Animation
on start {
player = world.spawn("character")
player.loadAnimation("assets/walk.fbx")
player.loadAnimation("assets/run.fbx")
player.loadAnimation("assets/idle.fbx")
player.play("idle", { blendTime: 0.2 })
}
on update(dt) {
speed = player.getSpeed()
if speed > 5 {
player.play("run", { blendTime: 0.15 })
} else if speed > 0.1 {
player.play("walk", { blendTime: 0.2 })
} else {
player.play("idle", { blendTime: 0.3 })
}
}Node Script Example
The same logic can be implemented using Node Scripting. Here is the equivalent node graph:
[On Update] ──► [Get Player Speed] ──► [Branch]
├─ speed > 5 ──► [Play: "run", blend 0.15]
├─ speed > 0.1 ──► [Play: "walk", blend 0.2]
└─ else ──► [Play: "idle", blend 0.3]Interchangeable Systems
Common Mistakes
Avoid these frequent mistakes when working with skeletal animation:
Not setting animation blend times
Always specify blendTime to avoid jarring transitions.
Playing animations on wrong objects
Ensure the target object has a skeleton matching the animation.
Forgetting to stop animations when objects are destroyed
Call player.stopAnimation() in cleanup to prevent errors.
Using root motion without configuring the character controller
Enable root motion on the controller or disable it on the animation.
Troubleshooting
If you encounter issues with skeletal animation, try these solutions:
Animation plays but character doesnt move
Transition between animations is jerky
Animation clips are missing after import
IK causes limbs to jitter
Performance Tips
Optimize your use of skeletal animation with these performance tips:
- Use animation state machines for characters with many states.
- Set blend times of 0.1-0.3s for smooth transitions without feeling sluggish.
- Use animation events to trigger sound effects and gameplay logic at precise frames.
- Use blend trees for directional movement (8-way blending).
Related Pages
Explore these related documentation pages:
Example Project
Download a complete example project demonstrating skeletal animation:
