PlayAnimationPath
A function added by the kNVSE Plugin.
Contents
Description
Plays the specified animation sequence path. The animation will automatically deactivate when it reaches the end key, unlike ActivateAnim which requires manual deactivation. This function is safer to use than ActivateAnim for most animation needs. PlayAnimationPath is a good option for activating additive animations.
Syntax
actor.PlayAnimationPath anim sequence path:string bIsFirstPerson:0/1
Example
PlayAnimationPath "Characters\Recoil.kf" 1
The PlayAnimationPath function plays the specified animation sequence path. Unlike ActivateAnim, this function is designed to automatically deactivate the animation after it reaches its end key, making it safer and more convenient for most animation needs.
- anim sequence path is the path to the animation sequence. The path must be based from Meshes\, but should not include it in the string for most anim group based animations but should contain the prefix for idle animations.
- bIsFirstperson specifies if the animation should be played on the player character's first person or third person skeleton. If the target actor is an NPC it will default to 0. If no value is specified and the reference is the player character it will default to the current point of view of the player.
The animation will play on top of all other animations that are currently playing. Which nodes are affected are determined by each interpolator's priority within the animation.
Although the animation will automatically deactivate when it reaches its end key, you can still manually deactivate it using DeactivateAnim if needed.
Behavior
- The animation will automatically deactivate after reaching its end key (non-looping animations only)
- The function will return 1 if the animation was successfully activated, 0 otherwise
- If the animation is already playing, it will be deactivated first and then reactivated
- The animation uses its default sequence weight and ease-in time values
When to Use PlayAnimationPath vs. ActivateAnim
PlayAnimationPath is generally safer to use than ActivateAnim for most animation needs because:
- It automatically deactivates when the animation completes
- It has fewer parameters to manage
- It handles common animation tasks with sensible defaults
ActivateAnim should be used when you need more precise control over:
- Animation priorities
- Weight values
- Ease-in timing
- Time synchronization with other animations
- Looping animations that need to persist