Quote:
Originally Posted by martinx1
I wouldn't advise on using the threading module. The game was desgined to be single thread, if you spawn another thread you might run into race conditions and thus get random crashes.
|
Its not possible to set a time.sleep(delay) without crash or freezing?
then i can prefer only this solution:
Code:
if app.GetTime() < timeyouwant:
code the part when the timer is running
else
after timer stopped
or
Code:
def SetSleepFunction(self, time):
self.function_sleep_time = app.GetGlobalTimeStamp() + time
def OnUpdate(self):
if self.function_sleep_time and self.function_sleep_time < app.GetGlobalTimeStamp():
self.function_sleep_time = None
# Your action
Its from another Forum, because the most People have Problems with them.
Best Regards, Endless.