1. 程式人生 > >UE4 程式碼設定AiContoller

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());
}