RealDocs

UAnimInstance::UnlockAIResources

function Engine Blueprint Deprecated Since 4.7
Deprecated: Use UnlockAIResourcesWithAnimation instead
#include "Animation/AnimInstance.h"
Access: public Specifiers: ENGINE_APIUFUNCTIONBlueprintCallable

Description

Releases AI movement and/or logic resource locks previously acquired by `LockAIResources`. Deprecated since UE 5.0 — use `UnlockAIResourcesWithAnimation` instead.

Caveats & Gotchas

  • Only unlocks resources that were locked via `LockAIResources`; it will not release locks created by Behavior Tree or other systems. Mismatched lock/unlock calls can leave the AI permanently stuck.
  • Like LockAIResources, this is BlueprintAuthorityOnly. On clients the call silently does nothing, so always ensure movement is driven by replication or RPC rather than direct AI resource locking.

Signature

UFUNCTION(BlueprintCallable, Category = "Animation", BlueprintAuthorityOnly, Meta=(DeprecatedFunction, DeprecationMessage="Use UnlockAIResourcesWithAnimation instead"))
ENGINE_API void UnlockAIResources(bool bUnlockMovement, bool UnlockAILogic)

Parameters

Name Type Description Default
bUnlockMovement bool If true, releases the animation lock on the AI movement resource.
UnlockAILogic bool If true, releases the animation lock on the AI logic resource.

Return Type

void

Example

Legacy unlock after montage ends C++
void UMyAnimInstance::OnMontageEnded(UAnimMontage* Montage, bool bInterrupted)
{
    // Deprecated path — prefer UnlockAIResourcesWithAnimation
    UnlockAIResources(true, true);
}

Version History

Introduced in: 4.7

Version Status Notes
5.6 deprecated Use UnlockAIResourcesWithAnimation instead.
5.0 deprecated Deprecated in UE 5.0.

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.