Ticks within a tick?

0 favourites
  • 4 posts
  • I have a problem I've ran into a few times, and I'm curious as to the reasoning. Anytime I do a "set sprite position to xy" and change the animation simultaneously, I actually see the new animation in the old position for the very beginning millisecond of the tick.

    I do this in order to maneuver around having to use the platform/bullet tool for incredibly complex movements.

    ie. I have a blob that is falling from the ceiling. I play the drop animation, and once finished, it needs to go to the falling animation. However in order to keep the "edge" of the blob on the wall, the origin image point can't move, so it needs to change position once the drop animation is finished in order to look smooth. If I do an "on animation finished, play "fall animation" & set sprite location to new location, I will see the sprite at the old location so fast that I can't even pause it in time, regardless of what order my code is in.

    Is there a better way to do stuff like this?

  • I have noticed the same behavior just very recently. In my case I wanted after an animation finished to play a new animation mirrored. For some reason (I confirmed it in the debugger), the last tick of the last frame of the first animation was mirrored, even if the mirror was not the first action of the "on animation finished" event. This happened every time.

    My workaround is to add a 0.01 wait before the mirroring action.

    So, in your case try this:

    =>On "DropAnim" finish:

    • System wait 0.01 seconds
    • Set animation to "Falling" (play from...)
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • eli0s - ah good find! I thought it was during the move, so I tried the wait action AFTER the set animation, which obviously didn't work. Thanks!

  • I'm glad it worked!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)