Is there any reason why a behavior tree just wouldn’t run? I have my game set up to spawn 2 AIs every 10 seconds, and once I get >16 AIs in the level, the BT sometimes doesn’t run on the new ones.
I set up a custom AI Controller to automatically run a BT specified in the Pawn’s defaults
void AUnitAIController::Possess(APawn* possessedPawn)
{
Super::Possess(possessedPawn);
//Run the BT specified in the Class Defaults
auto baseUnit = Cast<ABaseUnit>(possessedPawn);
if (baseUnit != nullptr)
{
if (!RunBehaviorTree(baseUnit->DefaultBehaviorTree))
{
//Debugging code goes here
}
}
}
If I put a breakpoint inside that if it never gets hit, so the call to RunBehaviorTree seems to be succeeding, but the AI never moves and if I try to debug the BT using that AI’s Controller, it doesn’t show up in the drop-down.