Module |
|
Header |
/Engine/Source/Runtime/AIModule/Classes/Blueprint/AIBlueprintHelperLibrary.h |
Include |
#include "Blueprint/AIBlueprintHelperLibrary.h" |
Source |
/Engine/Source/Runtime/AIModule/Private/Blueprint/AIBlueprintHelperLibrary.cpp |
static APawn * SpawnAIFromClass
(
UObject * WorldContextObject,
TSubclassOf< APawn > PawnClass,
UBehaviorTree * BehaviorTree,
FVector Location,
FRotator Rotation,
bool bNoCollisionFail,
AActor * Owner
)
Spawns AI agent of a given class. The PawnClass needs to have AIController set for the function to spawn a controller as well.
Parameter |
Description |
---|---|
BehaviorTree |
if set, and the function has successfully spawned and AI controller, this BehaviorTree asset will be assigned to the AI controller, and run. |
Owner |
lets you spawn the AI in a sublevel rather than in the persistent level (which is the default behavior). |