2D Toolkit Forum

2D Toolkit => Support => Topic started by: Disastercake on June 01, 2012, 06:09:36 am

Title: Issue with animations pausing for a split second if interrupted for another
Post by: Disastercake on June 01, 2012, 06:09:36 am
I am having an issue where if I interrupt an animation mid-play and then play another, it will make an awkward pause before playing the next animation.  This pause is quite noticeable.  How can I fix this?

Here is a video displaying the issue:
http://www.youtube.com/watch?v=phzq6jzZ7Zo&feature=youtu.be
Title: Re: Issue with animations pausing for a split second if interrupted for another
Post by: unikronsoftware on June 01, 2012, 12:05:11 pm
This looks like its caused by the animation updating before your function gets called. i.e. its switched to the next frame on your old animation, before your function call to change the frame tells it to change animation, and so it will only update the next frame.

Anyway to fix it you can try one of a few things.

First, in tk2dAnimatedSprite, change Update to LateUpdate and see how that works.

Also, if you know who is calling play on the sprite (if its another script which you have control over), in Edit > Project Settings > Script Execution Order, make sure that script is BEFORE this one.

Hope that helps, at least to narrow down where the problem is occuring.
Title: Re: Issue with animations pausing for a split second if interrupted for another
Post by: Disastercake on June 01, 2012, 03:55:57 pm
I found an error in my own code that was causing this bug.  Thank you for the help! =)
Title: Re: Issue with animations pausing for a split second if interrupted for another
Post by: unikronsoftware on June 02, 2012, 07:21:15 pm
Glad its fixed :)