Cube2222
(Cube2222)
March 22, 2014, 6:19pm
1
How would I go about creating a self destruction timer? I’m trying to use the examples from here Gameplay Timers | Unreal Engine Documentation , 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
.
Cube2222
(Cube2222)
March 22, 2014, 7:09pm
3
Well, sadly, this doesn’t work too. But thank you for making clear how to get a reference to the class itself.
Rama
(Rama)
March 22, 2014, 7:54pm
4
Have a function
void AYourActor::TimedDestroy()
{
Destroy();
}
start a timer somewhere, within the same class
GetWorldTimerManager().SetTimer(this,
&AYourActor::TimedDestroy(), 22, false);
Cube2222
(Cube2222)
March 22, 2014, 8:31pm
5
Thank you very much It’s working.