Timer not html timing
smurfted
Member, PRO Posts: 586
So i i've got a hand animated character and their animation is timed by use of the game timer (i also tried a timer behaviour set at "after so long do it")
It works great in the editor but in html it seems to ignore the timer and just animate as fast as possible?!
Anyone else seen this? Is this a known issue? Anyone got a workaround? Will Luke really turn to the darkside?
Comments
I'd use a rotating actor as the animation controller.
Constrain the frame number to the Rotation of the controller.
rotating using the rotate behaviour or manually?
What does 'manually' mean in this context ?
lol. i mean mathmatically
ie. rotation = rotation+1
Ah, I see what you mean now ! You could do it that way . . . although you would give up some flexibility.
A better way would be to simply rotate the controller actor at the frame rate you want, if you want the animation to play at a frame rate of 30fps then rotate the controller at 30°/second (counterclockwise), if you want a frame rate of 60fps then rotate the controller at 60°/second (counterclockwise) . . . . if you want the animation to play backwards at 24fps then rotate the controller at 24°/second (clockwise) . . . etc etc.
You can use whatever you want to rotate the controller, Change Angular Velocity, Rotate, Rotate to Angle, Rotate to Position, Interpolate Rotation . . . etc
Then constrain the animation actor's image to the controller's rotation.
So if your sequence was a 20 frame animated loop of a walk cycle and was named like this:
Walk_0 . . . Walk_1 . . . Walk_2 . . . Walk_3 . . . Walk_4 . . . etc, you would constrain the animation actor's self.image to:
"Walk_"..floor(controller.Rotation)%20
Demo file attached:
Well wake me up with doughnuts and orange juice. That was pretty smooth lad..
This is the test i've got up and running, its a little laggy at first (but i'm still happy with it).
http://arcade.gamesalad.com/games/141896
Cheers again socks, you rock..
updated it a little..