unreal.AIHelperLibrary

class unreal.AIHelperLibrary(outer=None, name='None')

Bases: unreal.BlueprintFunctionLibrary

AIBlueprint 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) –

Returns

Return type

AIController

classmethod get_blackboard(target)BlackboardComponent

Get Blackboard

Parameters

target (Actor) –

Returns

Return type

BlackboardComponent

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) –

Returns

Return type

NavigationPath

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) –

Returns

Return type

int32

classmethod get_current_path_points(controller)

Returns an array of navigation path points given controller is currently using.

Parameters

controller (Controller) –

Returns

Return type

Array(Vector)

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) –

Returns

Return type

int32

classmethod is_valid_ai_direction(direction_vector)bool

Is Valid AIDirection

Parameters

direction_vector (Vector) –

Returns

Return type

bool

classmethod is_valid_ai_location(location)bool

Is Valid AILocation

Parameters

location (Vector) –

Returns

Return type

bool

classmethod is_valid_ai_rotation(rotation)bool

Is Valid AIRotation

Parameters

rotation (Rotator) –

Returns

Return type

bool

classmethod lock_ai_resources_with_animation(anim_instance, lock_movement, lock_ai_logic)None

locks indicated AI resources of animated pawn

Parameters
classmethod send_ai_message(target, message, message_source, success=True)None

Send AIMessage

Parameters
classmethod simple_move_to_actor(controller, goal)None

Simple Move to Actor

Parameters
classmethod simple_move_to_location(controller, goal)None

Simple Move to Location

Parameters
classmethod spawn_ai_from_class(world_context_object, pawn_class, behavior_tree, location, rotation=[0.0, 0.0, 0.0], 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) –

  • pawn_class (type(Class)) –

  • 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).

Returns

Return type

Pawn

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