Hey there,
I’m trying to follow along to get the level restart timer working, but am running into an issue where I cannot compile the SetTimer, as the APlayerController reference doesn’t seem to work?
My ShooterPlayerController.cpp:
#include "ShooterPlayerController.h"
#include "TimerManager.h"
void AShooterPlayerController::GameHasEnded(class AActor* EndGameFocus, bool bIsWinner)
{
Super::GameHasEnded(EndGameFocus, bIsWinner);
UE_LOG(LogTemp, Warning, TEXT("Game has ended!"));
GetWorldTimerManager().SetTimer(RestartTimer, this, &APlayerController::RestartLevel(), RestartDelay);
}
&APlayerController gets red squiggles, and when hovered over it says “expression must be an lvalue or a function designator”
The compile error in UE4:
K:\MiscUnrealProjects\SimpleShooter\Source\SimpleShooter\ShooterPlayerController.cpp(15) : error C2664: 'void FTimerManager::SetTimer<AShooterPlayerController>(FTimerHandle &,UserClass *,void (__cdecl AShooterPlayerController::* )(void),float,bool,float)': cannot convert argument 3 from 'void *' to 'void (__cdecl AShooterPlayerController::* )(void)'
Thanks for any help!