UE4 代码设置AiContoller

// Sets default values
AEnemyCharacter::AEnemyCharacter()
{
     // Set this character to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
    PrimaryActorTick.bCanEverTick = true;
    //设置AIController
    AIControllerClass = AEnemyAIController::StaticClass();
}

// Called when the game starts or when spawned
void AEnemyCharacter::BeginPlay()
{
    Super::BeginPlay();
    
    //AEnemyAIController* Ai = Cast<AEnemyAIController>(GetController());
}

猜你喜欢

转载自blog.csdn.net/m0_37981386/article/details/83653812