2D Toolkit Forum
2D Toolkit => Support => Topic started by: Metik on May 31, 2013, 12:42:03 pm
-
Hi,
I observed a strange behavior that sometimes animation event (trigger) is not fired. I'm using Unity 4.1.3f3 and Tookit2d 1.92 + patch1.
My guess is that it is not fired if the preceding or maybe following animation frame is skipped due to framerate drop(for example).
Is it a valid diagnosis?
If so then shouldn't 2dToolkit fire all the events from skipped frames if framerate drop happens?
I have a characters in my game that have some long attack animations where at some particular frame a bullet is fired and the animation continues. Unfortunately sometimes animation event is not triggered and my bullet is not fired. This behavior forces me to split animation into parts because animation end event is always fired. This is highly inconvenient beacuse I have many animations to split.
Thanks in advance!
-
Try some things.
· Do you have some kind of flag in your code? e.g. There's some bool check in your event code that prevents the flow from entering there if certain conditions are met.
· Are you looping the entire animation? e.g. If you are using "Loop section", make sure that the event keyframe is located within the looped section.
So far we haven't experienced any trouble with animation events. In fact, we use them a lot, and the main character alone has more than 50 animations.
-
tk2d should fire all events, regardless of skipped frames. The only situation I am aware of where it will miss events, is if it loops over the animation 2x in one frame. Only one set of events will be fired there.
-
Thank you all for the responses. You helped me to find the reason and I'm going to send a followup message to Unikron.