Animator component, configure a default pose, and call its API methods whenever you want to play a clip.
Component Properties
The following two properties appear in the Inspector whenSimpleAnimationPlayer is added to a GameObject.
bool
When enabled, animations played by
SimpleAnimationPlayer are layered on top of an existing Animator Controller. The Animator continues to run its state machine, and the clip played by SimpleAnimationPlayer blends over it. When disabled, no Animator Controller is needed — the Default Clip Pose is used as the base pose instead.AnimationClip
The animation clip that plays as the resting pose when Use Animator is
false. Assign your weapon’s idle or held pose here. This clip loops continuously as the base layer until another clip is triggered via PlayAnimation.SimpleAnimationPlayer must be placed on the same GameObject as the Animator component. It hooks into the Playables API underneath and requires the Animator to be present to function.Use Cases
SimpleAnimationPlayer is the recommended approach for animated props and weapons. Rather than creating and maintaining a separate Animator Controller for every item in your game, you keep animation logic in code and simply call PlayAnimation or PlayBasePlayable when an action occurs. This keeps your asset database clean and makes it easy to add new items without any additional Animator Controller authoring.
Typical scenarios include:
- Playing a weapon idle pose on equip.
- Triggering a reload animation when the player reloads.
- Playing an inspect or interact animation on demand.
- Driving secondary prop animations (torch flicker, barrel sway) from gameplay events.
API Reference
PlayAnimation
AnimationAsset is a CAS ScriptableObject that wraps an AnimationClip and adds per-asset control over playback speed and blend settings.
Returns true if the animation started successfully, or false if the asset was null or playback failed.
PlayBasePlayable
AnimationClip as the base pose and starts playing it immediately. Use this to establish the looping idle pose for a prop or weapon on equip, before any action animations are triggered.
Code Example
The following script demonstrates a complete weapon animation setup usingSimpleAnimationPlayer. On Start, it establishes the weapon’s idle pose; a separate method triggers the reload animation when called by gameplay logic.
SimpleAnimationPlayer automatically blends back to the base pose clip you set with PlayBasePlayable. You do not need to manually restore the idle state.