Advertisement
orfeasel

Destroying Actor using Lambda

Feb 10th, 2016
25,150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. FTimerHandle TimerHandle;
  2.  
  3. FTimerDelegate TimerDelegate;
  4.  
  5. //Binding our Lambda expression
  6. TimerDelegate.BindLambda([&]()
  7. {
  8.     //Typing the logic of our function here just like any other function...
  9.     GLog->Log("Destroying Actor now...");
  10.     Destroy();
  11. });//Don't forget the ";" in the end of your parenthesis!
  12.  
  13. GetWorld()->GetTimerManager().SetTimer(TimerHandle, TimerDelegate, 5.f, false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement