I’m following this tutorial (Rama’s TCP Socket Listener) and I’ve encountered the following compiler error:
error C2664: ‘void FTimerManager::SetTimer(FTimerHandle &,float,bool,float)’: cannot convert argument 1 from 'AYourClass *const ’ to ‘FTimerHandle &’
I didn’t change anything from the tutorial (except moving the code in Laaaaaauuuunch function to BeginPlay function; I even named the class YourClass just like in the tutorial.
The tutorial is out-of-date. The first parameter should be an FTimerHandle object which you should retain in order to identify your timer in future calls:
FTimerHandle MyHandle;
// Sets MyHandle
TimerManager->SetTimer(MyHandle, MyObj, MyDelegate, MyRate);
...
// Replaces your previous timer with a new one
TimerManager->SetTimer(MyHandle, MyObj2, MyDelegate2, MyRate2);
...
// Clears your timer
TimerManager->ClearTimer(MyHandle);