Timeline and animation
Audity connects to Unity’s animation systems in two ways: a set of Timeline
track, clip and marker types (present when the com.unity.timeline package is
installed), and an Audity Animation Bridge component that lets ordinary
AnimationClips - .anim assets, played by any Animator Controller - drive graph
parameters and triggers. Both are thin adapters over the same
scripting surface your game code uses.
Everything here is forward-only, the way event-driven content behaves in a DAW: sounds start when the playhead reaches them and ring out on their own clock. Scrubbing the timeline does not audition Audity content; preview in Play mode.
The Audity Track
Section titled “The Audity Track”Add Audity > Audity Track to a timeline and bind it to an Audity Source. Its clips play the source for the clip’s span:
- Clip start calls
Play(orPlayQuantizedwhen the clip’s Start Quantize is set - the timeline keeps moving; the sound starts on the transport boundary). - Clip end calls
Stop. The clip’s ease-in / ease-out handles become the fade-in and fade-out, so shaping the fade is just dragging the clip’s corners. - Pausing the director leaves the sound ringing (a paused transport, not a stop); stopping the director stops the sound through the fade-out.
Animated parameters on a clip
Section titled “Animated parameters on a clip”A clip exposes two animatable lanes: Value A and Value B, each bound to a named interface member. Pick the member on the clip, then key the value in the clip’s Curves lane - the curves are stored inside the timeline asset as ordinary animation data and are pushed to the playing instance every frame. Two lanes cover the common “sweep a filter while riding a gain” case; for more, use the Animation Bridge below on an Animation track.
Trigger markers
Section titled “Trigger markers”Audity > Trigger Marker fires a named trigger when the playhead passes it. Place markers on an Audity Track (they fire on that track’s bound source) or on the timeline’s own marker lane (they fire on the director’s object). The receiving object’s Audity Source picks the trigger up directly - no extra component needed.
Each marker has:
- Trigger Name - the Trigger member to fire; empty fires every Trigger In,
like the anonymous
Trigger(). - Quantize - Immediate fires at the playhead. A grid mode snaps the trigger to the transport, which lands it musically right: at or after the marker, not visually on it.
- Retroactive - also fire when playback starts past the marker, for set-the-scene triggers.
The Transport Track
Section titled “The Transport Track”Audity > Transport Track makes the timeline the owner of a musical grid. Each clip on it publishes a transport: while the playhead is inside the clip, the named transport is anchored so beat 0 sits at the clip’s start. Timeline bars and transport bars then agree by construction - a quantized marker placed on a timeline bar line lands where the timeline says. A tempo change is just the next clip. Set the director’s Update Method to DSP Clock for the tightest agreement.
Driving Audity from .anim files (Animator Controllers)
Section titled “Driving Audity from .anim files (Animator Controllers)”Unity animation writes component fields, and AuditySource’s parameters are
methods - so the bridge is the Audity Animation Bridge component
(Add Component > Audio > Audity Animation Bridge). It works with any
AnimationClip, anywhere clips play: Animator Controllers, blend trees, Timeline
Animation tracks. An Audity Source is optional: with none present, the bridge
drives the sibling (or assigned) AudioSource’s slot-authored graph directly.
- Value lanes - each lane names an interface member and exposes a
Valuefield. KeyValuein your.anim; the bridge pushes changes to the source every frame. In a blend tree the curves blend before the bridge reads them, so a walk-to-run blend sweeps your “speed” parameter for free. A negative Smooth Seconds uses each member’s authored glide; 0 follows the curve exactly. - Trigger lanes - key the lane’s
Valueas a 0 to 1 spike; the lane fires its Trigger member on the rising edge through 0.5. Curve edges survive blending and crossfades more predictably than AnimationEvents. AudityTrigger(string)- an AnimationEvent-callable method: add an event at the exact frame and give it the Trigger member’s name.- Animator lanes - forward an Animator Controller parameter (not a keyed
curve) to a member: the locomotion
Speedblend parameter, a grounded bool. The value already steering the blend tree drives the graph with no game code. Float, Int, and Bool parameters forward (Bool as 0/1); Trigger parameters don’t - use a trigger lane or AnimationEvent for those.
The footstep recipe
Section titled “The footstep recipe”- On the walk and run clips, add AnimationEvents at the heel-strike frames
calling AudityTrigger with
"Footstep"(or key a trigger lane’s spike at those frames). - In the footstep Sound Graph, a Trigger In (“Footstep”) fires a Wave Player whose Sample Set holds the variants - selection policy and the graph’s randomness give per-step variation with no extra code.
- For surfaces, expose an Enum member (“Surface”) and a Switch Route into per-surface players; the game sets the enum, the animation only ever says “a foot landed”.
Footstep triggers use Immediate delivery - they belong to the animation, not the musical grid.
At crowd scale
Section titled “At crowd scale”A parked instance waiting on triggers runs its graph every audio block and holds an AudioSource voice - fine for a hero, wasteful times 100 characters. For crowds, flip the pattern: author the footstep graph as a finite one-shot (On Play fires the step; the instance retires after the tail), leave Play On Enable off, and point the AnimationEvent at AudityPlay instead of AudityTrigger. Idle characters then cost nothing, and a shared Batch Group on the sources caps how many steps sound at once (steal the farthest, or coalesce a marching burst into one composite).
From code-built playable graphs
Section titled “From code-built playable graphs”AuditySourcePlayable.Create(graph, source) is the Audity counterpart of
AudioClipPlayable for hand-built PlayableGraphs - no timeline package
needed. The returned playable plays the source on its first processed frame,
pushes its two animatable parameter lanes each frame, and stops with the
fade-out when destroyed; give it a duration (SetDuration) to stop at a known
end instead. It is a lifecycle handle, not an audio pipe: sound still renders
through the source’s generator slot, so there is no seeking and no
AudioMixerPlayable blending - fades and mixing are the Sound Graph’s job.
Trigger notifications work the same way: push any INotification implementing
IAudityTriggerNotification at an output whose bound object carries the
Audity Source.
Installing
Section titled “Installing”The Timeline types appear automatically when com.unity.timeline is in the
project (Audity does not depend on it; the integration compiles only when the
package is present). The Animation Bridge is part of the core runtime and is
always available.