RealDocs

AAIController::ClaimTaskResource

function AIModule Blueprint Since 4.7
#include "AIController.h"
Access: public Specifiers: UFUNCTIONBlueprintCallable

Description

Claims a gameplay task resource at the controller level, preventing any GameplayTask from using that resource until it is explicitly released via UnclaimTaskResource.

Caveats & Gotchas

  • Resources claimed via ClaimTaskResource are separate from resources claimed by individual UGameplayTask instances. Script-level claims (this function) persist until UnclaimTaskResource is called, not until the task ends.
  • Over-claiming resources will silently block Behavior Tree tasks that depend on those resources, causing them to be deferred indefinitely. Always pair every ClaimTaskResource with an UnclaimTaskResource.

Signature

void ClaimTaskResource(TSubclassOf<UGameplayTaskResource> ResourceClass)

Parameters

Name Type Description Default
ResourceClass TSubclassOf<UGameplayTaskResource> The resource class to claim. Claiming a resource locks it so competing tasks cannot use it simultaneously.

Return Type

void

Example

Lock movement resource during a cutscene C++
// During a scripted sequence, prevent BT tasks from issuing movement
ClaimTaskResource(UGameplayTaskResource_Move::StaticClass());

// ... later, when the sequence ends:
UnclaimTaskResource(UGameplayTaskResource_Move::StaticClass());

Version History

Introduced in: 4.7

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.