SAnimatorStateInfo
On this classIsName
| Function | IsName | Does name match the name of the active state in the statemachine? |
| Function | IsTag | Does tag match the tag of the active state in the statemachine. |
| Property | fullPathHash | The full path hash for this state. |
| Property | nameHash | The hashed name of the State. |
| Property | shortNameHash | The hash is generated using SAnimator.StringToHash. |
| Property | normalizedTime | Normalized time of the State. |
| Property | length | Current duration of the state. |
| Property | speed | The playback speed of the animation. 1 is the normal playback speed. |
| Property | speedMultiplier | _The speed multiplier for this state. |
| Property | tagHash | _The Tag of the State. |
| Property | loop | Is the state looping. |
| Property | Length | Current duration of the state. |
Functions
IsName
Does name match the name of the active state in the statemachine?
Parameters
| Name | Type | Default |
|---|---|---|
| name | string | – |
Returns
bool
Example
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
AnimationStateInfo.isName("aStateName")
IsTag
Does tag match the tag of the active state in the statemachine.
Parameters
| Name | Type | Default |
|---|---|---|
| tag | string | – |
Returns
bool
Example
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
AnimationStateInfo.isTag("aStateTag")
Properties
fullPathHashRead only
The full path hash for this state. The hash is generated using Animator.StringToHash.
Example
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
fullPathHash = AnimationStateInfo.fullPathHash
nameHashRead only
The hashed name of the State.
Example
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
nameHash= AnimationStateInfo.nameHash
shortNameHashRead only
The hash is generated using SAnimator.StringToHash. The hash does not include the name of the parent layer.
Example
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
shortNameHash= AnimationStateInfo.shortNameHash
normalizedTimeRead only
Normalized time of the State. The integer part is the number of time a state has been looped. The fractional part is the % (0-1) of progress in the current loop.
Example
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
normalizedTime= AnimationStateInfo.normalizedTime
lengthRead only
Current duration of the state. In seconds Can vary when the State contains a Blend Tree.
Example
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
length= AnimationStateInfo.length
speedRead only
The playback speed of the animation. 1 is the normal playback speed. A negative playback speed will play the animation from the end.
Example
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
speed= AnimationStateInfo.speed
speedMultiplierRead only
_The speed multiplier for this state.
A negative speed multiplier will play the animation backwards. If no speed parameter as been set for this SAnimatorState, the default value will be 1._
Example
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
speedMultiplier= AnimationStateInfo.speedMultiplier
tagHashRead only
_The Tag of the State.
The hash is generated using SAnimator.StringToHash._
Example
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
tagHash= AnimationStateInfo.tagHash
loopRead only
Is the state looping. All animations in the state must be looping.
Example
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
loop= AnimationStateInfo.loop
LengthRead only
Current duration of the state. In seconds Can vary when the State contains a Blend Tree
Example
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
Length= AnimationStateInfo.Length



