# Animation

### Animation Class

Represents a scriptable Animation node.

### Syntax

### Member Details

#### GetFrameCount Method

> Gets the frame count of the animation
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [int](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Int32) **GetFrameCount** ()
>
> **Returns**
>
> > Returns the total number of frames in the animation.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### GetName Method

> Gets the name of the animation
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) **GetName** ()
>
> **Returns**
>
> > Returns the name of the animation.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### GetParameters Method

> Gets the last applied parameters for the animation
>
> #### Syntax
>
> **Returns**
>
> > Returns the current parameters.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### IsPaused Method

> Gets whether or not the animation is paused.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [bool](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean) **IsPaused** ()
>
> **Returns**
>
> > A bool value indicating the pause state.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### JumpToFrame Method

> Jump to frame. The animation will be set to the specified frame, and paused.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [void](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **JumpToFrame** ([int](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Int32) frame)
>
> **Parameters**
>
> > *frame*
> >
> > Frame to jump to.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### JumpToFrame Method

> Jump to frame. The animation will be set to the specified frame, and paused.
>
> #### Syntax
>
> **Parameters**
>
> > *frame*
> >
> > Frame to jump to.
> >
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### JumpToFrame Method

> Jump to frame. The animation will be set to the specified frame, and paused.
>
> #### Syntax
>
> **Parameters**
>
> > *frame*
> >
> > Frame to jump to.
> >
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Pause Method

> Pauses the animation.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [void](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **Pause** ()
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Pause Method

> Pauses the animation.
>
> #### Syntax
>
> **Parameters**
>
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Pause Method

> Pauses the animation.
>
> #### Syntax
>
> **Parameters**
>
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Play Method

> Plays the animation. It will become the active animation for this object, and resume playing if it is paused.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [void](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **Play** ()
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Play Method

> Plays the animation, without changing the current animation frame.
>
> #### Syntax
>
> **Parameters**
>
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Play Method

> Plays the animation and applies the provided parameters.
>
> #### Syntax
>
> **Parameters**
>
> > *parameters*
> >
> > Animation parameters to apply.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Play Method

> Plays the animation. It will become the active animation for this object, and resume playing if it is paused.
>
> #### Syntax
>
> **Parameters**
>
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Play Method

> Plays the animation and applies the provided parameters.
>
> #### Syntax
>
> **Parameters**
>
> > *parameters*
> >
> > Animation parameters to apply.
> >
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Play Method

> Plays the animation and applies the provided parameters.
>
> #### Syntax
>
> **Parameters**
>
> > *parameters*
> >
> > Animation parameters to apply.
> >
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Reset Method

> Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled).
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [void](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **Reset** ()
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Reset Method

> Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled).
>
> #### Syntax
>
> **Parameters**
>
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Reset Method

> Resets the animation and applies the provided parameters.
>
> #### Syntax
>
> **Parameters**
>
> > *parameters*
> >
> > Animation parameters to apply.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Reset Method

> Resets the animation. The animation is paused and reset to frame 0 (or the RangeStartFrame if clamping is enabled).
>
> #### Syntax
>
> **Parameters**
>
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Reset Method

> Resets the animation and applies the provided parameters.
>
> #### Syntax
>
> **Parameters**
>
> > *parameters*
> >
> > Animation parameters to apply.
> >
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Reset Method

> Resets the animation and applies the provided parameters.
>
> #### Syntax
>
> **Parameters**
>
> > *parameters*
> >
> > Animation parameters to apply.
> >
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### SetParameters Method

> Sets the parameters for the animation. The parameters are applied immediately.
>
> #### Syntax
>
> **Parameters**
>
> > *parameters*
> >
> > Animation parameters to apply.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### SetParameters Method

> Sets the parameters for the animation. The parameters are applied immediately.
>
> #### Syntax
>
> **Parameters**
>
> > *parameters*
> >
> > Animation parameters to apply.
> >
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### SetParameters Method

> Sets the parameters for the animation. The parameters are applied immediately.
>
> #### Syntax
>
> **Parameters**
>
> > *parameters*
> >
> > Animation parameters to apply.
> >
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

***

### AnimationComponent Class

The AnimationComponent handles interactions with animations.

### Syntax

### Member Details

#### ComponentId Property

> Retrieves the component id for this AnimationComponent.
>
> #### Syntax
>
> **Value**
>
> > The id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### ComponentType Field

> #### Syntax
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### DefaultAnimation Property

> Gets the default scriptable animation.
>
> #### Syntax
>
> \[get: Sansar.Script.Interface]\
> public [Animation](https://help.sansar.com/hc/en-us/articles/360000770006) **DefaultAnimation** { get; }
>
> **Value**
>
> > An Animation object.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### EnqueueEvent Method

> Enqueues an event for this component.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [void](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **EnqueueEvent** ([int](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Int32) internalId)
>
> **Parameters**
>
> > *internalId*
> >
> > The id of the animation event, may be looked up by name from [AnimationComponent.GetEventId(string)](https://help.sansar.com/hc/en-us/articles/115003512907#M:Sansar.Simulation.AnimationComponent.GetEventId\(System.String\))
>
> **Returns**
>
> > The internal event id for the completion event.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### EnqueueEvent Method

> Enqueues an event for this component.
>
> #### Syntax
>
> **Parameters**
>
> > *internalId*
> >
> > The id of the animation event, may be looked up by name from [AnimationComponent.GetEventId(string)](https://help.sansar.com/hc/en-us/articles/115003512907#M:Sansar.Simulation.AnimationComponent.GetEventId\(System.String\))
> >
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > The internal event id for the completion event.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### EnqueueEvent Method

> Enqueues an event for this component.
>
> #### Syntax
>
> **Parameters**
>
> > *internalId*
> >
> > The id of the animation event, may be looked up by name from [AnimationComponent.GetEventId(string)](https://help.sansar.com/hc/en-us/articles/115003512907#M:Sansar.Simulation.AnimationComponent.GetEventId\(System.String\))
> >
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > The internal event id for the completion event.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### GetAnimation Method

> Finds a scriptable animations by name.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [Animation](https://help.sansar.com/hc/en-us/articles/360000770006) **GetAnimation** ([string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) animationName)
>
> **Parameters**
>
> > *animationName*
> >
> > The name of the animation.
>
> **Returns**
>
> > An Animation, or null if no animation was found with the correct name.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### GetAnimations Method

> Gets the scriptable animations for this object.
>
> #### Syntax
>
> **Returns**
>
> > An IEnumarable collection of animation objects.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### GetEventId Method

> Lookup the event id for the named event.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [int](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Int32) **GetEventId** ([string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) eventName)
>
> **Parameters**
>
> > *eventName*
> >
> > The name of the event to query.
>
> **Returns**
>
> > The id of the named event or -1 if the name is not valid.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### GetVectorAnimationVariable Method

> Get a Vector type variable from the animation by name
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [Sansar.Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) **GetVectorAnimationVariable** ([string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) variableName)
>
> **Parameters**
>
> > *variableName*
> >
> > The name of the animation variable
>
> **Returns**
>
> > A Mono.Simd.Vector4f of the value of the named variable
>
> **Exceptions**

| Type                                                                                                  | Reason                                                                              |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [ArgumentException](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.ArgumentException)         | Thrown when attempting to get a variable that doesn't exist or is of the wrong type |
| [ArgumentNullException](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.ArgumentNullException) | If variableName is null                                                             |

> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### HasEvent Method

> Check this component for the existence of the named event.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [bool](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean) **HasEvent** ([string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) eventName)
>
> **Parameters**
>
> > *eventName*
> >
> > The name of the event to query.
>
> **Returns**
>
> > true if the event exits.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Name Property

> This AnimationComponent name, as specified in the editor.
>
> #### Syntax
>
> \[get: Sansar.Script.Interface]\
> public [string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) **Name** { get; }
>
> **Value**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### SetPosition Method

> Asynchronously set the position for this object.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [void](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **SetPosition** ([Sansar.Vector](https://docs.sansar.com/latest/script-api-docs/sansar-namespace/vector) position)
>
> **Parameters**
>
> > *position*
> >
> > The Mono.Simd.Vector4f position desired.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### SetPosition Method

> Asynchronously set the position for this object.
>
> #### Syntax
>
> **Parameters**
>
> > *position*
> >
> > The Mono.Simd.Vector4f position desired.
> >
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### SetPosition Method

> Asynchronously set the position for this object.
>
> #### Syntax
>
> **Parameters**
>
> > *position*
> >
> > The Mono.Simd.Vector4f position desired.
> >
> > *handler*
> >
> > Handler to be called when the event completes.
>
> **Returns**
>
> > Returns an internal event id.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Subscribe Method

> Subscribes to Animation Events.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> \[System.Obsolete("Use subscription callbacks of type Action\<Sansar.Simulation.AnimationData>", true)]\
> public [void](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **Subscribe** ([string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) BehaviorName, [AnimationComponent.SubscriptionHandler](https://help.sansar.com/hc/en-us/articles/115003438103) callback, [bool](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean) persistent)
>
> **Parameters**
>
> > *BehaviorName*
> >
> > The behavior name of the Animation. This name will match the subscribed event.
> >
> > *callback*
> >
> > Callback which is executed when the event completes.
> >
> > *persistent*
> >
> > Optional, set to false to unsubscribe after one event.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### Subscribe Method

> Subscribes to Animation Events.
>
> #### Syntax
>
> **See Also**
>
> **Parameters**
>
> > *BehaviorName*
> >
> > The behavior name of the Animation. This name will match the subscribed event.
> >
> > *callback*
> >
> > Callback which is executed when the event completes.
> >
> > *persistent*
> >
> > Optional, set to false to unsubscribe after one event.
>
> **Returns**
>
> > An [Sansar.Script.IEventSubscription](https://docs.sansar.com/latest/script-api-docs/sansar-script-namespace/ievent-subscription) that can be used to cancel the subscription.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### ToString Method

> A string representation of this object.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public override [string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) **ToString** ()
>
> **Returns**
>
> > A string representation of this object.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

***

### AnimationComponent.SubscriptionHandler Delegate

Animation events.

### Syntax

\[Sansar.Script.Interface]\
\[System.Obsolete("Use subscription callbacks of type Action\<Sansar.Simulation.AnimationData>", false)]\
public delegate [void](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void) **AnimationComponent.SubscriptionHandler** ([string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) BehaviorName, [Sansar.Script.ComponentId](https://help.sansar.com/hc/en-us/articles/115003545928) ComponentId)

**Parameters**

> *BehaviorName*
>
> The behavior name of the Animation. This name will match the subscribed event.
>
> *ComponentId*
>
> The id of the animation component.

### Remarks

### Requirements

**Namespace:** Sansar.Simulation\
**Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
**Assembly Versions:** 1.1.0.0

***

### AnimationData Class

Animation events.

### Syntax

### Member Details

#### BehaviorName Property

> The behavior name of the Animation. This name will match the subscribed event.
>
> #### Syntax
>
> \[get: Sansar.Script.Interface]\
> public [string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) **BehaviorName** { get; }
>
> **Value**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### ComponentId Property

> The id of the animation component.
>
> #### Syntax
>
> **Value**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### ToString Method

> A string representation of this object.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public override [string](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String) **ToString** ()
>
> **Returns**
>
> > A string representation of this object.
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

***

### AnimationParameters Struct

The AnimationParameters struct contains settings for playing animations.

### Syntax

\[Sansar.Script.Interface]\
public struct **AnimationParameters**

### Member Details

#### BlendDuration Field

> Time in seconds taken to blend to this animation.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **BlendDuration**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### ClampToRange Field

> If true, clamp the animation frames to the range specified by rangeStartFrame and rangeLength. If false, play the whole animation.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [bool](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean) **ClampToRange**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### PlaybackMode Field

> Animation playback mode.
>
> #### Syntax
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### PlaybackSpeed Field

> Animation playback speed. Negative values will play the animation backwards.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [float](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Single) **PlaybackSpeed**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### RangeEndFrame Field

> End frame to use when clamping animation range. This should always be greater or equal to the range start frame.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [int](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Int32) **RangeEndFrame**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

#### RangeStartFrame Field

> Start frame to use when clamping animation range.
>
> #### Syntax
>
> \[Sansar.Script.Interface]\
> public [int](http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Int32) **RangeStartFrame**
>
> #### Remarks
>
> #### Requirements
>
> **Namespace:** Sansar.Simulation\
> **Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
> **Assembly Versions:** 1.1.0.0
>
> ***

***

### AnimationPlaybackMode Enum

Enumeration for the different animation playback modes

### Syntax

\[Sansar.Script.Interface]\
public enum **AnimationPlaybackMode**

### Remarks

### Members

| Member Name  | Description                                                    |
| ------------ | -------------------------------------------------------------- |
| **Loop**     | Loop indefinitely.                                             |
| **PingPong** | Play indefinitely, alternating between forwards and backwards. |
| **PlayOnce** | Play once then stop.                                           |

### Requirements

**Namespace:** Sansar.Simulation\
**Assembly:** Sansar.Simulation (in Sansar.Simulation.dll)\
**Assembly Versions:** 1.1.0.0

***
