Animation
Overview
UCAnimInstance is the custom UAnimInstance subclass used by all characters. It provides a typed variable system for driving AnimBlueprint state, automatic computation of speed/direction/lean/slope, montage priority management, and integration with the combat state machines. CMontageNotifier defines the AnimNotify classes used for combat events.
UCAnimInstance
| Name |
Description |
| readAnimBoolVar / writeAnimBoolVar |
Read/write typed bool variables (falling, accelerating, sprinting, fighting, top-viewing, interrupted) |
| readAnimFloatVar / writeAnimFloatVar |
Read/write typed float variables (speed, direction, slope angle, lean angle, roll, pitch, yaw) |
| readAnimFNameVar / writeAnimFNameVar |
Read/write typed FName variables |
| readAnimFVectorVar / writeAnimFVectorVar |
Read/write typed FVector variables |
| readAnimFTransformVar / writeAnimFTransformVar |
Read/write typed FTransform variables |
| cdryxAnimSequenceMap |
Named animation sequences from FCCharacterDetailMaker::animSequenceMap |
| cdryxBlendSpaceMap |
Named blendspaces from FCCharacterDetailMaker::blendspaceMap |
| setPriority |
Sets montage priority for the priority-based playback system |
| comparePriority |
Compares two montage priorities (used by ICAnimePrioritizer) |
// Typed variable system — used in AnimBlueprint via BlueprintCallable getters:
animInstance->writeAnimBoolVar(CAnimBoolVar::CDRYX_FIGHTING, true);
bool fighting = animInstance->readAnimBoolVar(CAnimBoolVar::CDRYX_FIGHTING);
float speed = animInstance->readAnimFloatVar(CAnimFloatVar::CDRYX_SPEED);
float direction = animInstance->readAnimFloatVar(CAnimFloatVar::CDRYX_DIRECTION);
// FName-based variants for custom variables (not in the enum):
animInstance->writeAnimBoolVar_(FName("MY_CUSTOM_BOOL"), true);
bool custom = animInstance->readAnimBoolVar_(FName("MY_CUSTOM_BOOL"));
// Every write triggers moveOnAllSimpleStateMachine() to advance combat state machines.
Bool Variables (CAnimBoolVar)
| Name |
Description |
| CDRYX_FALLING |
True when the movement component reports falling |
| CDRYX_ACCELERATING |
True when current acceleration is non-zero |
| CDRYX_SPRINTING |
Sprint state |
| CDRYX_FIGHTING |
Fight mode active |
| CDRYX_TOPVIEWING |
True when spring arm does not inherit pitch (top-view mode) |
| CDRYX_INTERRUPTED |
Set by C_INTERRUPTED_AN notify window |
Float Variables (CAnimFloatVar)
| Name |
Description |
| CDRYX_SPEED |
2D velocity magnitude |
| CDRYX_DIRECTION |
Movement direction relative to actor rotation |
| CDRYX_SLOPE_ANGLE |
Pitch angle between previous and current location (terrain slope) |
| CDRYX_LEAN_ANGLE |
Yaw delta rate for leaning in turns |
| CDRYX_ROLL / CDRYX_PITCH / CDRYX_YAW |
Aim rotation delta relative to actor rotation |
Template Sequence Names (ECAnimeTemplateSequenceName)
Named slots for the AnimBlueprint template CdryxTemplateAnimBP:
| Name |
Description |
| IDLE_ANIM_SEQUENCE |
Idle animation |
| WALK_ANIM_SEQUENCE |
Walk animation |
| RUN_ANIM_SEQUENCE |
Run animation |
| JUMP_1_START_ANIM_SEQUENCE |
Jump start |
| JUMP_2_APEX_ANIM_SEQUENCE |
Jump apex (optional) |
| JUMP_3_FALL_LOOP_ANIM_SEQUENCE |
Fall loop |
| JUMP_4_RECOVERY_ADDITIVE_ANIM_SEQUENCE |
Landing recovery additive (optional) |
Template Blendspace Names (ECAnimeTemplateBlendspaceName)
| Name |
Description |
| LOOKAROUND_BLENDSPACE_2D |
X = yaw, Y = pitch — head look-around |
| WALKWITHLEANANDSLOPE_BLENDSPACE_2D |
X = lean, Y = slope — walk with body tilt |
| RUNWITHLEANANDSLOPE_BLENDSPACE_2D |
X = lean, Y = slope — run with body tilt |
CMontageNotifier
AnimNotify classes for combat events. Each notify triggers a named event consumed by UCCombotterComponent and UCAnimInstance.
| Name |
Notify Name |
Description |
| UCHit_MontageNotifier |
C_HIT_AN |
Melee hit detection point |
| UCCanCombo_MontageNotifier |
C_CANCOMBO_AN |
Opens the combo window |
| UCNoMoreCombo_MontageNotifier |
C_NOMORECOMBO_AN |
Closes the combo window |
| UCStartBlock_MontageNotifier |
C_STARTBLOCK_AN |
Block becomes active |
| UCEndBlock_MontageNotifier |
C_ENDBLOCK_AN |
Block ends |
| UCStartRange_MontageNotifier |
C_STARTRANGE_AN |
Range attack ready (can shoot) |
| UCShotRange_MontageNotifier |
C_SHOTRANGE_AN |
Projectile launch point |
| UCEndRange_MontageNotifier |
C_ENDRANGE_AN |
Range attack ends |
| UCInterrupted_MontageNotifier |
C_INTERRUPTED_AN |
Notify window: sets/clears CDRYX_INTERRUPTED bool |
// Montage notifiers are placed on AnimMontage timelines in the editor.
// They fire named events that drive the combat state machines:
// C_HIT_AN -> UCCombotterComponent::whatIfHitMelee()
// C_CANCOMBO_AN -> opens combo window in attack state machine
// C_NOMORECOMBO_AN -> forces combo window close
// C_STARTBLOCK_AN -> transitions block STM to S_BLOCKING
// C_ENDBLOCK_AN -> transitions block STM to S_NOT_BLOCKING
// C_STARTRANGE_AN -> transitions range STM to S_BOW_DRAWING
// C_SHOTRANGE_AN -> triggers projectile launch
// C_ENDRANGE_AN -> transitions range STM to S_ATTACK_FINISHED
// C_INTERRUPTED_AN -> window notify: sets/clears CDRYX_INTERRUPTED bool