UnrealScripterAI
Discord ↗
Link Copied to Clipboard
×
"make an npc"
ANPC::ANPC() { PrimaryActorTick.bCanEverTick = true; MeshComponent = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Mesh Component")); RootComponent = MeshComponent; AIControllerClass = ANPCAIController::StaticClass(); } void ANPC::BeginPlay() { Super::BeginPlay(); // Spawn the AI Controller AIController = GetWorld()->SpawnActor<ANPCAIController>(AIControllerClass); AIController->Possess(this); }