GameSalad

Timer not html timing

smurftedsmurfted Posts: 419Member, PRO

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

  • SocksSocks London, UK.Posts: 12,754Member

    I'd use a rotating actor as the animation controller.

    Constrain the frame number to the Rotation of the controller.

  • smurftedsmurfted Posts: 419Member, PRO

    rotating using the rotate behaviour or manually?

  • SocksSocks London, UK.Posts: 12,754Member
    edited April 22

    @smurfted said:
    rotating using the rotate behaviour or manually?

    What does 'manually' mean in this context ?

  • smurftedsmurfted Posts: 419Member, PRO

    lol. i mean mathmatically

    ie. rotation = rotation+1

  • SocksSocks London, UK.Posts: 12,754Member
    edited April 24

    @smurfted said:
    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

  • SocksSocks London, UK.Posts: 12,754Member

    Demo file attached:

  • smurftedsmurfted Posts: 419Member, PRO

    Well wake me up with doughnuts and orange juice. That was pretty smooth lad..

  • smurftedsmurfted Posts: 419Member, PRO

    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..

  • smurftedsmurfted Posts: 419Member, PRO

    updated it a little..

Sign In or Register to comment.