UAnimInstance::InitializeAnimation
#include "Animation/AnimInstance.h"
Access: public
Specifiers: ENGINE_APIvirtual
Description
Initializes the animation instance, setting up all animation nodes, state machines, and internal data structures. Called automatically by the skeletal mesh component when the anim instance is first created or when the animation blueprint is reassigned.
Caveats & Gotchas
- • Do not call this manually in most cases — the skeletal mesh component calls it at the right time. Calling it out of sequence can reset state machines and lose in-progress animation state.
- • NativeInitializeAnimation is called from within this function. If you need custom initialization, override NativeInitializeAnimation rather than this method.
Signature
ENGINE_API virtual void InitializeAnimation(); Return Type
void Example
Force re-initialization after blueprint swap C++
// After changing the anim class at runtime
Mesh->SetAnimInstanceClass(NewAnimBPClass);
// InitializeAnimation is called automatically by SetAnimInstanceClass;
// no manual call needed Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?