📗
FPS Animation Framework Legacy
  • 👋Welcome!
  • ⭐Introduction
  • Tutorial
    • 🌟Getting started
      • 🏃‍♂️Character setup
      • 📷Camera setup
      • 🔶Layers setup
      • 🔷Controller setup
      • 🔫Weapon setup
    • 💻Integration
      • 🏃‍♂️Character
      • 🔫Weapon
      • 🔸Layers and animator
    • 🔥Animation Workflow
      • 🦿IK Rig
      • 🔧Character Animation
      • 🔧Weapon Animation
    • ❗Troubleshooting
      • ❔Issue with IK, Left Hand, ADS
      • ❔Broken Character Pose
      • ❔Spinning Character
      • ❔Left Hand IK Always Active
      • ❔Left Hand IK Error
      • ❔Transform NaN Error
  • Fundamentals
    • 🦾Animation System
      • 🔹Playables Sub-System
      • 🔹Curve-blending
      • 🔸AnimSequence
      • 🔸Weapon Bone
      • 🔸IK Animation System
      • 🔸Weapon Anim Asset
    • 🔶Animation Layers
      • Ads Layer
      • Left Hand IK Layer
      • Right Hand IK Layer
      • Locomotion Layer
      • Look Layer
      • Recoil Layer
      • Sway Layer
      • Leg IK
      • Weapon Collision
      • Slot Layer
      • Pose Blending
  • Tools
    • 🟢Validator Tool
Powered by GitBook
On this page
  • CoreAnimGraph
  • Methods and properties
  1. Fundamentals
  2. Animation System

Playables Sub-System

In this section you will learn more about CoreAnimGraph

PreviousAnimation SystemNextCurve-blending

Last updated 1 year ago

CoreAnimGraph

CoreAnimGraph is responsible for dynamically playing animations and poses from code, as well as for curve-blending.

Think of it as an extension for the Unity Animator, where you can play animations right from code.

CoreAnimGraph is based on 's and a custom CoreAnimMixer playables. The structure of the whole graph is this:

Unity Animator - pose from your animator controller.

Overlay Poses - animation mixer, that blends static poses. Static poses are important for the proper IK placement and blending with dynamic animations.

Dynamic Animations - any motion played from code via the PlayAnimation() method.

Methods and properties

CoreAnimGraph.cs
// Called when a character is instantiated or initialized.
public bool InitPlayableGraph()

// Called every frame to update the mixers and weights.
public void UpdateGraph()

// Returns spine root rotation for this animation.
public Quaternion GetSpineOffset()

// Returns the curve value of the CoreAnimGraph, not the Animator (!!!).
// CoreAnimGraph has its own system for curve blending.
public float GetCurveValue(string curveName)

// Returns the blending progress of the static pose.
public float GetPoseProgress()

// Sets the graphWeight.
public void SetGraphWeight(float weight)

// Plays a static pose.
public void PlayPose(AnimationClip clip, float blendIn, float playRate = 1f)

// Plays a dynamic animation.
public void PlayAnimation(AnimationClip clip, AnimTime blendTime, Quaternion spineRot, AnimCurve[] curves = null)

// Stops currently playing animation.
public void StopAnimation(float blendTime)

// Returns if graph is playing.
public bool IsPlaying()

// Updates all mixers weights.
public void UpdateGraphWeights()

// Plays the first frame of the clip on the character.
public void SamplePose(AnimationClip clip)

public AvatarMask GetUpperBodyMask()

// Starts in-editor preiview.
public void StartPreview()
// Stops in-editor preiview.
public void StopPreview()
CoreAnimGraph.cs
// If 1 - the graph is fully enabled, if 0 - disabled.
public float graphWeight;

// What bones will be animated by static poses and animations.
[SerializeField] private AvatarMask upperBodyMask;

// Max amount of blending animations or poses.
[Tooltip("Max blending poses")] private int maxPoseCount = 3;
[Tooltip("Max blending clips")] private int maxAnimCount = 3;
🦾
🔹
AnimationLayerMixerPlayable