USkeletalMeshComponent::PlayAnimation
#include "Components/SkeletalMeshComponent.h"
Access: public
Description
Plays an animation asset directly on the skeletal mesh, bypassing the Animation Blueprint. Useful for simple one-off animations when a full anim graph is not needed.
Signature
void PlayAnimation(class UAnimationAsset* NewAnimToPlay, bool bLooping) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| NewAnimToPlay | UAnimationAsset* | The animation asset to play (AnimSequence, AnimMontage, BlendSpace, etc.). | — |
| bLooping | bool | Whether the animation should loop. | — |
Return Type
void Caveats & Gotchas
- • This disables the Animation Blueprint — calling PlayAnimation will override and disconnect the assigned Anim Blueprint for the duration.
- • For characters with complex locomotion, prefer driving animation through the Anim Blueprint and calling Montage_Play on the UAnimInstance instead.
- • There is no blend-in; the switch is immediate.
Example
Play a looping idle on a prop mesh C++
PropMesh->PlayAnimation(IdleAnimation, true); Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?