# Sandbox.Npcs.Layers.AnimationLayer

Animation state for the NPC's model: movement, look target and one-shot triggers.
Synced properties replicate it to all clients, where an animator component (such as
[Sandbox.Npcs.CitizenNpcAnimator](/api/Sandbox.Npcs.CitizenNpcAnimator)) reads it and drives the model. Also turns the body
toward the look target and plays footsteps from the model's footstep events.
A mover publishes its state here on the host: [Sandbox.Npcs.Layers.AnimationLayer.SetMove](/api/Sandbox.Npcs.Layers.AnimationLayer/SetMove), [Sandbox.Npcs.Layers.AnimationLayer.IsGrounded](/api/Sandbox.Npcs.Layers.AnimationLayer/IsGrounded),
[Sandbox.Npcs.Layers.AnimationLayer.Traversal](/api/Sandbox.Npcs.Layers.AnimationLayer/Traversal) and [Sandbox.Npcs.Layers.AnimationLayer.TraversalDirection](/api/Sandbox.Npcs.Layers.AnimationLayer/TraversalDirection). One that owns the NPC's orientation, such as a
wall-walker, turns [Sandbox.Npcs.Layers.AnimationLayer.TurnsBody](/api/Sandbox.Npcs.Layers.AnimationLayer/TurnsBody) off.

- Kind: class
- Namespace: `Sandbox.Npcs.Layers`
- Assembly: `Sandbox.Engine`
- Inherits: [Sandbox.Npcs.Layers.BaseNpcLayer](/api/Sandbox.Npcs.Layers.BaseNpcLayer)

## Constructors

- [`AnimationLayer`](/api/Sandbox.Npcs.Layers.AnimationLayer/.ctor)

## Properties

- [`EnableFootstepSounds`](/api/Sandbox.Npcs.Layers.AnimationLayer/EnableFootstepSounds): Play footstep sounds from the model's footstep animation events.
- [`FootstepVolume`](/api/Sandbox.Npcs.Layers.AnimationLayer/FootstepVolume): Overall footstep volume multiplier.
- [`IsGrounded`](/api/Sandbox.Npcs.Layers.AnimationLayer/IsGrounded): Whether the NPC is on its feet rather than in the air, for the animator. Set on the host and synced. The NPC sets it every update for a mover that uses the ground (`P:Sandbox.Npcs.Layers.MovementLayer.UsesGround`); any other mover sets it itself.
- [`IsLooking`](/api/Sandbox.Npcs.Layers.AnimationLayer/IsLooking): Whether the NPC has a look target right now, synced to all clients.
- [`LookObject`](/api/Sandbox.Npcs.Layers.AnimationLayer/LookObject): The object the NPC is looking at, when its look target is an object, synced to all clients.
- [`MoveVelocity`](/api/Sandbox.Npcs.Layers.AnimationLayer/MoveVelocity): How fast and which way the mover is taking the NPC, set through [Sandbox.Npcs.Layers.AnimationLayer.SetMove](/api/Sandbox.Npcs.Layers.AnimationLayer/SetMove) and synced to all clients.
- [`Traversal`](/api/Sandbox.Npcs.Layers.AnimationLayer/Traversal): The type of the nav link currently being animated, such as [Sandbox.Engine.Resources.NavMeshLinkType.Ladder](/api/Sandbox.Engine.Resources.NavMeshLinkType/Ladder). Null off links and on plain ones, and while approaching a drop. Set on the host by the mover and synced.
- [`TraversalDirection`](/api/Sandbox.Npcs.Layers.AnimationLayer/TraversalDirection): Which way the link being crossed goes: 1 up, -1 down, 0 level. Set on the host by the mover and synced.
- [`TurnsBody`](/api/Sandbox.Npcs.Layers.AnimationLayer/TurnsBody): Whether this layer turns the standing NPC's body toward its look target. On by default. Turn it off when the mover owns the NPC's orientation; the head and eyes still follow the look target.
- [`WeaponStance`](/api/Sandbox.Npcs.Layers.AnimationLayer/WeaponStance): Whether the weapon is held up and ready or lowered, at ease. Synced to all clients.

## Methods

- [`CalculateLookPosition`](/api/Sandbox.Npcs.Layers.AnimationLayer/CalculateLookPosition): Where the NPC is looking, while [Sandbox.Npcs.Layers.AnimationLayer.IsLooking](/api/Sandbox.Npcs.Layers.AnimationLayer/IsLooking). Resolved from [Sandbox.Npcs.Layers.AnimationLayer.LookObject](/api/Sandbox.Npcs.Layers.AnimationLayer/LookObject) on each client when there is one.
- [`ClearLookTarget`](/api/Sandbox.Npcs.Layers.AnimationLayer/ClearLookTarget): Clear the persistent look target. The NPC will stop tracking.
- [`SetLookTarget`](/api/Sandbox.Npcs.Layers.AnimationLayer/SetLookTarget): Set a persistent look target that tracks a GameObject each frame.
- [`SetMove`](/api/Sandbox.Npcs.Layers.AnimationLayer/SetMove): Records move state for replication. Called on the host by whatever moves the NPC.
- [`Trigger`](/api/Sandbox.Npcs.Layers.AnimationLayer/Trigger): Fire a named one-shot (such as "attack") on every client, for animators to react to through `E:Sandbox.Npcs.Layers.AnimationLayer.Triggered`.
