Hello there!
I have a problem with assigning behavior tree to the newly spawned AActor.
My actor have empty AIController assigned to it.
But I need to do it out of AIController, in my spawner instead.
This task is quite easy in blueprint and looks like that:
My current code, what need to do the same here:
void AMobSpawner::SpawnMob(FMobType mobType)
{
ACharacter* character = GetWorld()->SpawnActor<ACharacter>(mobType.character, GetActorLocation(), FRotator(0.f, 0.f, 0.f), FActorSpawnParameters());
OnSpawnProgress(character, currentWave, currentSubWave, spawnedInTotal, spawnedInTotal, spawnedInWave, needToSpawnInWave);
AController* ai = character->AIControllerClass.GetDefaultObject();
// TODO: Ok, what next?
}
Can’t find this “Run Behavior Tree” function…