UAnimInstance::RecordStateWeight
#include "Animation/AnimInstance.h"
Access: public
Description
Records a state machine state's weight for the current frame so it can be reported to animation debugging and profiling tools.
Caveats & Gotchas
- • Called internally by the generated state machine update code (FAnimNode_StateMachine); you don't normally call this directly from gameplay code.
- • The recorded weight is consumed by the anim instance proxy for the Persona debugger and gameplay insights, not used to drive blending itself.
- • InMachineClassIndex and InStateIndex must match indices baked into the anim blueprint's generated class — passing arbitrary values produces meaningless debug data rather than an error.
Signature
void RecordStateWeight(const int32 InMachineClassIndex, const int32 InStateIndex, const float InStateWeight, const float InElapsedTime) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| InMachineClassIndex | const int32 | Index of the anim state machine within the anim blueprint's generated class. | — |
| InStateIndex | const int32 | Index of the state within the state machine. | — |
| InStateWeight | const float | Weight of the state for this update. | — |
| InElapsedTime | const float | Elapsed time in the state for this update. | — |
Return Type
void Example
Called from generated state machine code C++
// Inside FAnimNode_StateMachine::UpdateState (engine internal)
if (UAnimInstance* AnimInstance = Context.GetAnimInstanceObject())
{
AnimInstance->RecordStateWeight(MachineClassIndex, StateIndex, StateWeight, ElapsedTime);
} Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?