Navigation
API > API/Runtime > API/Runtime/AIModule > API/Runtime/AIModule/Blueprint > API/Runtime/AIModule/Blueprint/UAIBlueprintHelperLibrary
References
| Module | AIModule |
| Header | /Engine/Source/Runtime/AIModule/Classes/Blueprint/AIBlueprintHelperLibrary.h |
| Include | #include "Blueprint/AIBlueprintHelperLibrary.h" |
| Source | /Engine/Source/Runtime/AIModule/Private/Blueprint/AIBlueprintHelperLibrary.cpp |
UFUNCTION (BlueprintCallable, Category="AI",
Meta=(WorldContext="WorldContextObject", UnsafeDuringActorConstruction="true", AdvancedDisplay="Owner"))
static APawn * SpawnAIFromClass
(
UObject * WorldContextObject,
TSubclassOf < APawn > PawnClass,
UBehaviorTree * BehaviorTree,
FVector Location,
FRotator Rotation,
bool bNoCollisionFail,
AActor * Owner
)
Remarks
Spawns AI agent of a given class. The PawnClass needs to have AIController set for the function to spawn a controller as well.
Parameters
| Name | 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). |