UNREAL ENGINE FREEZES WHEN I GO TO EXPORT/BAKE ANIMATION

Edit for version 5.3 - had to change the line to Sleep(16); before it would work