UAnimInstance::NativeUninitializeAnimation
#include "Animation/AnimInstance.h"
Access: protected
Specifiers: virtualENGINE_API
Description
Called when the anim instance is being torn down, typically when the owning skeletal mesh component is destroyed or the animation blueprint is changed at runtime. Override this to clean up native resources or unbind delegates.
Caveats & Gotchas
- • Not called in the same frame as EndPlay — the anim instance may be uninitialized before or after the actor's EndPlay depending on the destruction order.
- • The skeletal mesh component may still be valid at this point, but do not rely on the anim graph state — nodes have already been released.
Signature
virtual void NativeUninitializeAnimation() Return Type
void Example
Clean up cached references on teardown C++
void UMyAnimInstance::NativeUninitializeAnimation()
{
CachedCharacter = nullptr;
CachedMovementComp = nullptr;
Super::NativeUninitializeAnimation();
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?