First frame of animation lasts 1 frame longer when changing animation

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Not sure if I'm misunderstanding how animation speed works here or if there's something wrong.

    I have timer-based movements turned off and have my animation speed set to 25. I believe this should make each frame of an animation last 4 frames.
    It does, except when changing animation. When I switch from idle animation to walking animation the first frame of the walk lasts 5 frames, then the rest go 4. When I switch back to idle the first frame of the idle lasts 5 then the rest are 4.
    I tried increasing the animation speed to 26, but then every few frames last only 3, so thats the wrong setting.

    I'm pretty sure 25 is the correct setting for 4 frames per animation frame but why is that first frame lasting a frame longer? Doesn't seem to be the code either. I tried testing with simple code like:

    Button is not held: Set animation to idle
    Button is held: Set animation to walk

    Even with this simple code the problem still happens. Any ideas?

    Edited 2 times, last by Psychoplasmics (August 22, 2023 at 7:09 PM).

  • The inner workings of the animation system are a mystery to me, but I would guess that perhaps it has something to do with the "Speed Counter".

    Fusion doesn't just track an animation's current frame number; it also tracks its "Speed counter", which as far as I can tell is kind of like the 'decimals' of the frame. In other words, the frames don't just go [1, 2, 3...]. They actually go [1.00, 1.01, 1.02........2.00, 2.01, 2.02.......3.00, 3.01, 3.02...]. The "Speed Counter" is the [.01, .02, .03] part.

    You can see the Speed Counter in the little screenshot below, from one of the debugging tools in my game that I use to track certain objects' animations:

    Please login to see this picture.

    In the above screenshot, I'm tracking an animation that has 20 frames, and is currently displaying frame 14. This frame's time is almost up: It is 82% finished (when it gets to 100%, Fusion will be ready to show frame 15)

    What I suspect is happening is that when you switch animations, the speed counter gets reset to 0. So maybe your frames are ticking over something like like this:


    1.25
    1.5
    1.75
    2.25


    But if you switch animations, then maybe it's doing something like this:


    1.25
    1.5
    ------------at this point, you change the animation sequence to "idle"-------
    1.00
    1.25
    1.5
    1.75
    2.25
    ...............which has caused the 1.xx animation frame to display for 1 extra cycle


    The numbers above are just some numbers that I threw down and are very unlikely to be accurate. But you get the general point: maybe the act of switching animation sequence and resetting the internal timer to 0 is causing the timer to go longer for that frame, for some reason or another.

    You can use the Animation Info Object to find out the current Speed Counter in the Expression Editor:


    Please login to see this picture.


    I'd recommend using Animation Info to monitor the Speed Counter to learn more about what's happening. As far as I know, there's no way to directly control the Speed Counter, but once you have a better idea of what's happening, perhaps you can tweak the timing or animation speed somehow to offset the delay.

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

    Edited 2 times, last by Volnaiskra (August 23, 2023 at 9:18 AM).

  • That makes sense thank you! Good to know about the animation object to get a better grasp on whats happening exactly. Hopefully this is a problem Clickteam can address with an update at some point with more control over the speed counter.

    In the meantime I've decided to just set animation frames manually with values. I thought there'd be problems but it was suprisingly easy to set up. Requires a couple events for each animation to set their number of frames and animation speed, but only takes few minutes and now I don't really need the built in animation system anymore.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!