Originally Posted by Mayron
My "animation" is not one that I thought an animation method could help me with as I wanted to run a function every set seconds until a condition is met. I thought these animations only let you do simpler things like alpha changes, rotations and others.
|
Well that's legit, but they can still be used as a timer (and seem to be popular as such).
To use OnUpdate properly, you need to do something along the lines of:
Code:
f.elapsed = 0
f:SetScript ("OnUpdate", function (self, elapsed,...)
f.elapsed = f.elapsed + elapsed
if f.elapsed > 0.5 then
...
f.elapsed = 0
end
end
(Off the top of my head, please don't murder me if I missed something)
Point is, the code you used was simply blocking the game 100% of the time. Being stuck in a while loop means nothing on the screen can update, so the game basically freezes.