Rick Posted August 4, 2011 Share Posted August 4, 2011 Playing with animation speed and it seems like AppTime() may be acting slowly? Below is the portion that controls speed of a given animation local appTime = AppTime() if appTime > v.lastTime + v.speed and v.complete == false then v.frame = v.frame + 1 v.lastTime = appTime end If I change v.speed on my model to 0 it runs just as fast as if it's 30. If I comment out the if check and just inc the frame at machine speed the animation is clearly really fast. So wondering why wouldn't having a v.speed value of 0 produce the same result as not having the if check at all and make it go really fast? To put it another way, the below code "should" basically be equal to not even having the if statement and just increasing the frame by 1 at the speed of the machine it's running. Yet this code below doesn't produce the same speed as just v.frame = v.frame + 1 without any checks. It would seem AppTime() is returning the same value through multiple loop interaction then as it doesn't pass that > check every cycle. local appTime = AppTime() if appTime > v.lastTime + 0 and v.complete == false then v.frame = v.frame + 1 v.lastTime = appTime end So if AppTime() can't be used for this, what would my options in Lua be to get accurate application running time in MS? Quote Link to comment Share on other sites More sharing options...
Rick Posted August 4, 2011 Author Share Posted August 4, 2011 Nvm, using os.clock() * 1000 as it works in Lua. Josh you gotta fix AppTime() man. I'm writing up a small bug report because AppTime() is jacked. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.