void AShooterAIController::BeginPlay()
{
Super::BeginPlay();
APawn* PlayerPawn = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);
SetFocus(PlayerPawn);
}
void AShooterAIController::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
APawn* PlayerPawn = UGameplayStatics::GetPlayerPawn(GetWorld(), 0);
MoveToActor(PlayerPawn, 200);
}
There is something I don’t understand even though I took a lecture haha…
MoveToActor only moved once when I wrote it on BeginPlay and it hasn’t moved since. Why?
And SetFocus requires AI to keep looking at players as they move. But I wonder why they’re calling from BeginPlay, not Tick.
Maybe I’m being too stupid…