Skip to main content

Animation

The Animation class provides methods for controlling animations on actors in your game. As a static module, you access its methods directly without instantiation. The class supports playing and stopping animations with extensive customization through the [FHelixPlayAnimParams](#fhelixplayanimparams) struct.

/// info Animation is a static module โ€” you donโ€™t instantiate it, but can access its methods.

Animations are automatically replicated to other Clients when called from either Client/Server. ///

Structsโ€‹

FHelixPlayAnimParamsโ€‹

Propertiesโ€‹

NameTypeDefaultDescription
LoopCountnumber1Number of times to loop the animation. 1 means play once.
PlayRatenumber1.0The playback speed of the animation. 1.0 is normal speed.
StartTimeSecondsnumber0.0Time offset in seconds to start the animation from.
bIgnoreMovementInputbooleanfalseIf true, player movement input will be ignored during the animation.
MovementModeEMovementModeMOVE_WalkingThe character movement mode to use (e.g., Walking, Flying). Use MOVE_Flying for animations with vertical root motion. Use MOVE_Walking if character needs to be grounded during the animation.
bIgnoreCorrectionsbooleanfalseIf true, the Character Movement Component will ignore network corrections during root motion.
RootMotionTranslationScalenumber1.0A multiplier for the translation of root motion in the animation. Increasing the value will increase distance travelled for root motion animations.
bEndAbilityOnAnimBlendOutbooleantrueIf true, the animation ability will end early with animationโ€™s blend-out event. Useful to smoothly blend to gameplay logic after animation.
bCanBeCancelledbooleantrueIf false, this animation cannot be cancelled by another gameplay ability trying to play an animation. Use this for critical animations.
bUseMotionWarpingbooleanfalseIf true, the actor will warp towards the WarpTargetTransform during the animation. Animation asset should have root motion enabled on its flags for this to work.
WarpTargetTransformTransformIdentityThe world-space transform to use as the motion warping target.
WarpTargetNamestringNoneThe name of the motion warp target in the animation notify. Leave it as None if not sure about what to use. This will auto-create a motion warping window if no window exists. If there is at least one window in the animation, it will be automatically selected.
AnimSlotNamestringDefaultSlotIf the AnimationAsset is an anim sequence, this specifies which animation slot to play it in. DefaultSlot or FullBody plays on the full body. UpperBody plays the animation on the upper body. Not used if provided animation asset is an anim montage.
BlendInTimenumber0.25Blend-in duration if the animation is played as a dynamic montage. Not used if provided animation asset is an anim montage.
BlendOutTimenumber0.25Blend-out duration if the animation is played as a dynamic montage. Not used if provided animation asset is an anim montage.

Functionsโ€‹

Playโ€‹

Plays the specificed animation or animation montage on a Target Actor with parameters.

local bSuccess = Animation.Play(TargetActor, '/Path/To/Animation.Animation', UE.FHelixPlayAnimParams(), function() print('Animation Ended') end)

Stopโ€‹

Stops the animation being played on the TargetActor.

Animation.Stop(TargetActor)
โœจ