unreal.AIHelperLibrary¶
- class unreal.AIHelperLibrary(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
BlueprintFunctionLibraryAIBlueprint Helper Library
C++ Source:
Module: AIModule
File: AIBlueprintHelperLibrary.h
- classmethod get_ai_controller(controlled_actor) AIController¶
- The way it works exactly is if the actor passed in is a pawn, then the function retrieves
pawn’s controller cast to AIController. Otherwise the function returns actor cast to AIController.
- Parameters:
controlled_actor (Actor)
- Return type:
- classmethod get_blackboard(target) BlackboardComponent¶
Get Blackboard
- Parameters:
target (Actor)
- Return type:
- classmethod get_current_path(controller) NavigationPath¶
- Returns a NEW UOBJECT that is a COPY of navigation path given controller is currently using.
The result being a copy means you won’t be able to influence agent’s pathfollowing by manipulating received path. Please use GetCurrentPathPoints if you only need the array of path points.
- Parameters:
controller (Controller)
- Return type:
- classmethod get_current_path_index(controller) int32¶
Return the path index the given controller is currently at. Returns INDEX_NONE if no path.
- Parameters:
controller (Controller)
- Return type:
int32
- classmethod get_current_path_points(controller) Array[Vector]¶
Returns an array of navigation path points given controller is currently using.
- Parameters:
controller (Controller)
- Return type:
Return the path index of the next nav link for the current path of the given controller. Returns INDEX_NONE if no path or no incoming nav link.
- Parameters:
controller (Controller)
- Return type:
int32
- classmethod lock_ai_resources_with_animation(anim_instance, lock_movement, lock_ai_logic) None¶
locks indicated AI resources of animated pawn
- Parameters:
anim_instance (AnimInstance)
lock_movement (bool)
lock_ai_logic (bool)
- classmethod simple_move_to_actor(controller, goal) None¶
Simple Move to Actor
- Parameters:
controller (Controller)
goal (Actor)
- classmethod simple_move_to_location(controller, goal) None¶
Simple Move to Location
- Parameters:
controller (Controller)
goal (Vector)
- classmethod spawn_ai_from_class(world_context_object, pawn_class, behavior_tree, location, rotation=[0.000000, 0.000000, 0.000000], no_collision_fail=False, owner=None) Pawn¶
Spawns AI agent of a given class. The PawnClass needs to have AIController set for the function to spawn a controller as well.
- Parameters:
world_context_object (Object)
behavior_tree (BehaviorTree) – if set, and the function has successfully spawned and AI controller, this BehaviorTree asset will be assigned to the AI controller, and run.
location (Vector)
rotation (Rotator)
no_collision_fail (bool)
owner (Actor) – lets you spawn the AI in a sublevel rather than in the persistent level (which is the default behavior).
- Return type:
- classmethod unlock_ai_resources_with_animation(anim_instance, unlock_movement, unlock_ai_logic) None¶
unlocks indicated AI resources of animated pawn. Will unlock only animation-locked resources
- Parameters:
anim_instance (AnimInstance)
unlock_movement (bool)
unlock_ai_logic (bool)