1
\$\begingroup\$

In Unreal Animation Blueprints, each state has an option for AlwaysResetOnEntry.

enter image description here

The tooltip text for this is:

Whether or not this state will ALWAYS reset its state on reentry, regardless of remaining weight


Question

What does this do, exactly?

Additionally, what is a good example of where this would be used?

\$\endgroup\$
0
\$\begingroup\$

I got this reply from someone outside of Stack exchange, so I'll post it here to help others


Searched the code for bAlwaysResetOnEntry, looks like its used for animation state machines.

Implies its possible to re-enter a state while it is still the active state, and the reset flag would cause the state to re-trigger, possibly re-calling the OnStateEntered events. Untitled

if ((!bAlreadyActive || bForceReset) && !IsAConduitState(NewStateIndex))
        {
            // Initialize the new state since it's not part of an active transition (and thus not still initialized)
            FAnimationInitializeContext InitContext(Context.AnimInstanceProxy);
            StatePoseLinks[NewStateIndex].Initialize(InitContext);
            // Also call cache bones if needed
            // Note dont call CacheBones here if we are in the process of whole-graph initialization as a 'never updated' counter
            // will not perform its 'minimal update guard' duty and every call will end up getting though, performing duplicate work
            // over Save/UseCachedPose boundaries etc.
            // This is OK because CacheBones is actually called before updating the graph anyway after whole-graph initialization
            if(Context.AnimInstanceProxy->GetCachedBonesCounter().HasEverBeenUpdated())
            {
                ConditionallyCacheBonesForState(NewStateIndex, Context);
            }
        }

bForceReset is assigned bAlwaysResetOnEntry earlier.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.