WaitForAnimationEnd¶
Purpose¶
Wait until an Animator state finishes or is interrupted.
Key inputs / outputs¶
- Inputs:
animation(currentorstageName), optionalstageName(VariableField<string>). - In
stageNamemode,stageNamemust be a full Layer 0 state path, such asBase Layer.AttackorBase Layer.Combat.Attack. - Outputs: none.
Success / Failure semantics¶
- In
currentmode, tracks the Layer 0 state active when the action starts. InstageNamemode, waits for the configured state to become current before tracking it. - Succeeds when the tracked state naturally finishes (non-looping state with normalized time at least
1), Layer 0 begins a transition, or the current state changes. - Looping states do not finish naturally; they remain active until interrupted by a transition or state change. Self-transitions also count as interruptions.
- Fails immediately when the host has no Animator or Runtime Animator Controller, Layer 0 has no valid current state in
currentmode, or the configured full path is empty or does not identify a Layer 0 state.
Important limitations¶
- Requires an Animator with a Runtime Animator Controller on the host object.
- Samples
FixedAnimator update mode inFixedUpdate;NormalandUnscaledTimemodes inUpdate.