How can I use a delay or a sleep in C++?

FPlatformProcess::Sleep(time);

It can will stop code execution which means it game will freeze if it will be executed in main thread

You need to use timers are they are 100% multithreaded, you can make them execute in loop, there also function to pause timers and check there time status, so try to operate it somehow. If you want time start diffrent for each actor, set the timers from different class (in first argument of SetTimer() is object you want function to be executed in)

Think out of the box, thats what you need to do in this kind of situations ;]

1 Like