Character Animation Setup¶
Character animation files are not included with the package. This guide shows one workflow for obtaining humanoid clips from Mixamo and retargeting them to the supplied worker models in Unity.
Third-party service
Mixamo is a third-party service and its interface or download options may change. Follow its current terms and licensing requirements. The package does not redistribute Mixamo animation files.
Required worker states¶
The supplied worker integration expects an Animator Controller with:
| Name | Type | Purpose |
|---|---|---|
Speed |
Float parameter | 0 while stationary, 1 while moving |
Idle |
State | Default stationary state |
Walk |
State | Locomotion |
Operate |
State | Working at a staffed device |
Sleep |
State | Sleeping at a bed slot |
Interact |
State | Generic furniture/device interaction |
Interaction slots call Operate, Sleep, and Interact by exact state name. Missing states are handled safely, but no interaction animation will play.
1. Prepare the character Avatar¶
For each worker character FBX:
- Select the model in the Project window.
- Open the Rig tab.
- Set Animation Type to Humanoid.
- Set Avatar Definition to Create From This Model.
- Choose Apply.
- Open Configure and confirm Unity displays a valid green Avatar.
- Verify Hips, upper/lower legs, feet, toes, spine, arms, hands, neck, and head.
- If needed, use Mapping > Automap and Pose > Enforce T-Pose.
- Choose Apply, then Done.
The supplied Ruby and Amber models already contain Humanoid mappings. Repeat configuration only when replacing the models or repairing an Avatar.
2. Choose and download animations¶
Recommended Mixamo downloads:
Format: FBX for Unity
Skin: Without Skin
Frames per Second: 30
Keyframe Reduction: your project preference
In Place: enabled for Walk/Run locomotion
Download at least Idle, Walking, a work animation, and a sleeping animation. The exact artistic choice is replaceable.
3. Import every animation FBX¶
For each downloaded animation:
- Select the animation FBX.
- Open Rig.
- Set Animation Type to Humanoid.
- Set Avatar Definition to Create From This Model.
- Choose Apply.
Do not select Copy From Other Avatar unless the source file has the exact same transform hierarchy and bone paths as the target Avatar.
Why “Hips not found” happens¶
A copied Avatar requires matching transform hierarchy. A character may contain a bone named Hips, while a downloaded animation contains mixamorig:Hips. Both can map correctly to the Humanoid Hips concept, but their transform paths are not identical.
Typical error:
Copied Avatar Rig Configuration mis-match.
Transform 'Hips' for human bone 'Hips' not found.
Fix it by changing the animation FBX to Humanoid > Create From This Model, applying, and configuring/automapping that file's own Avatar. Unity then retargets the Humanoid clip to each worker character.
If an old copied configuration remains stuck, temporarily apply Generic, then switch back to Humanoid > Create From This Model and apply again.
4. Configure locomotion clips¶
Select the walking FBX and open Animation:
- enable Loop Time;
- enable Loop Pose when it produces a cleaner cycle;
- under Root Transform Position (Y), enable Bake Into Pose and use Feet;
- under Root Transform Position (XZ), enable Bake Into Pose;
- apply the changes.
The worker moves its GameObject in code. An in-place clip with baked XZ movement prevents root-motion drift and double movement.
Settings are per clip
Replacing the Motion in the Walk state does not copy loop or root settings from the old FBX. Recheck the newly imported clip every time.
5. Configure the Animator Controller¶
Create a float parameter named Speed.
Recommended transitions:
Idle → Walk: Speed > 0.1, Has Exit Time off
Walk → Idle: Speed < 0.1, Has Exit Time off
Operate → Walk: Speed > 0.1
Sleep → Walk: Speed > 0.1
Interact → Walk: Speed > 0.1
Use a short transition duration such as 0.15. Set Idle as the default state. Enable Foot IK on Walk.
Assign the same controller to the Animator below both worker prefabs. Each character keeps its own Avatar; Humanoid retargeting applies the shared clips.
The demo helper can configure the supplied controller and clips:
Tools > Pixit Games > Space Station Survival > Setup Worker Animations
Twisted ankle or foot¶
Use this isolation sequence:
- Confirm the Walk state references the new clip rather than the previous Motion.
- Preview the animation on its source model. If the source foot is already broken, replace or repair the source clip.
- Test the same controller on both target characters. A defect on only one character points to that character's Avatar or bind pose.
- Verify Left/Right Foot and Toe mappings on both the source and target Avatars.
- Apply Enforce T-Pose to the affected target Avatar.
- Enable Foot IK on Walk.
- Set Root Transform Position Y to Feet.
The same ankle artifact across several valid clips usually indicates target Avatar pose, proportions, or bone axes rather than all source animations being defective.
Sliding, floating, and root drift¶
| Symptom | Likely cause | Fix |
|---|---|---|
| Animation stops after one cycle | Loop Time disabled on the current clip | Enable Loop Time and Apply |
| Character moves twice as fast | Root motion plus scripted movement | Use In Place, bake XZ, keep Apply Root Motion off |
| Feet slide | Clip speed differs from StationWorker.moveSpeed |
Adjust clip speed or worker move speed; use Foot IK |
| Whole model floats | Worker/model pivot offset | Verify runtime floor projection, then adjust model child local Y |
| Foot sinks during retargeting | Root Y based on body/original | Bake Y and use Feet |
| Character remains in Sleep/Operate | Missing return transition | Add Speed-driven transition to Walk |