I am trying to figure out how to have my code wait until a certain function has completed before carrying on. I hit a problem regularly where the game will crash if a player is too quick at for example reloading a level from scratch as the cleanup is still clearing up the level.
So I am trying to work out how to get the code to stop executing until something else has finished.
I can add a manual delay but that can give a player the feeling that the game is stuck or something and sometimes a piece of cleanup code or whatever may take lets say half a second one time but a full second at other times, sometimes more. I don’t want to have to put in an artificial 5 second delay or whatever as that breaks the whole flow and feel of the game.
Is it possible to check that a piece of code has actually finished executing completely?
If the above is not clear please ask.
Cheers
Mike R [import]uid: 9950 topic_id: 9401 reply_id: 309401[/import]
[import]uid: 12378 topic_id: 9401 reply_id: 34386[/import]