Download

Timers

How would I go about creating a self destruction timer? I’m trying to use the examples from here https://docs.unrealengine.com/latest/INT/Programming/UnrealArchitecture/Timers/index.html , but it doesn’t seem to work (it doesn’t compile), what I tried:



GetWorldTimerManager()::SetTimer(this, Destroy, 1.0f, false);


Destroy should be a pointer to a function, something like this


&FThisClass::Destroy

.

Well, sadly, this doesn’t work too. But thank you for making clear how to get a reference to the class itself.

Have a function


void AYourActor::TimedDestroy()
{
  Destroy();
}

start a timer somewhere, within the same class


GetWorldTimerManager().SetTimer(this, 
	&AYourActor::TimedDestroy(), 22, false);

Thank you very much :slight_smile: It’s working.