UBTService_FindRandomLocation
Overview
UBTService_FindRandomLocation is a Behavior Tree service designed to find a random reachable location within a specified radius around an origin point. It uses the navigation system to ensure the location is valid and stores the result in the blackboard for further use in the behavior tree.
Properties
Type | Name | Access | Description |
|---|---|---|---|
int32 | MaxAttempts | EditAnywhere | Maximum number of attempts to find a valid random location. |
FBlackboardKeySelector | OutLocation | EditAnywhere | Blackboard key selector for storing the found location. |
FBlackboardKeySelector | SearchOrigin | EditAnywhere | Blackboard key selector for specifying the origin point. |
float | MaxRadius | EditAnywhere | Maximum radius within which to search for a random location. |
float | MinRadius | EditAnywhere | Minimum radius from the origin point that the found location must be greater than. |
float | AcceptanceRadius | EditAnywhere | Radius used to check if the found location is valid (not used in this implementation). |
Functions
Return Type | Signature | Description |
|---|---|---|
void | OnSearchStart(FBehaviorTreeSearchData& SearchData) | Called when the search starts. Calls the base class method. |
void | TickNode(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds) | Ticks the node and attempts to find a random reachable location within the specified radius around the origin point. |
Usage & Implementation Notes
Threading Constraints: This service should be run on the game thread as it interacts with the navigation system.
Replication Requirements: None.
Memory Lifetime Management: The service does not manage any dynamic memory that requires special handling.
Initialization Dependencies: Requires a valid
UNavigationSystemV1and an actor to use as the origin point.