I am getting this error when I compile the game:
error C2039: ‘GetPlayerCharactor’: is not a member of ‘UGameplayStatics’
here is the section of code causing the error.
void AMainGameMode::OnSwitch()
{
if (Switched)
{
FVector NewLocation = UGameplayStatics::GetPlayerCharactor(GetWorld(), 0)->GetActorLocation();
NewLocation.X = 1200.0f
UGameplayStatics::GetPlayerCharactor(GetWorld(), 0)->SetActorLocation(NewLocation);
}
else
{
FVector NewLocation = UGameplayStatics::GetPlayerCharactor(GetWorld(), 0)->GetActorLocation();
NewLocation.X = 200.0f
UGameplayStatics::GetPlayerCharactor(GetWorld(), 0)->SetActorLocation(NewLocation);
}
Switched = !Switched;
}