- Home /
Animation Event not working with syncLayer ?
I'm utilizing the new Animation Editor in Unity 2.6.1 adding Animation Events to clips in the timeline. However it doesn't seem to work if using the SyncLayer funtion in the animation script. For example, I'm using the animation editor to add an event to the "run" animation to call a "playFootStepSound" function, it simply does not work if the animation's layer is set to syncLayer.
I have seen this issue briefly mentioned on the forums (see below), but there hasn't been a confirmation whether this is a known bug to be fixed soon, or whether there are workarounds etc.
It would be a shame not to be able to use both of these essential and powerful features in conjunction.
http://forum.unity3d.com/viewtopic.php?t=13333&highlight=animationevent
Answer by runevision · Feb 12, 2010 at 01:29 PM
I can reproduce this bug. We'll work on getting it fixed.
Answer by Gabriel 1 · Feb 27, 2010 at 08:51 PM
This bug was also in 2.5. It also doesn't execute Animation Events when the animation is cross fading.
Answer by MaDDoX · Dec 21, 2010 at 01:36 AM
I can confirm this bug is still happening in 3.1. It might be just an oversight, or the way Unity designed things. Apparently Unity only considers that an animation is "active" - for event checkings, etc - after any transition that are blending into it are complete. For our game we had to add a "fire hack" toggle for the weapons with instant or very early fire (relative to the animation start). For weapons with a relatively long pre-attack, ie. attack starts after some preparation move, events work just fine. Another alternative is having another layer with fake animations (ie. that doesn't affect the actual animations) but with the same duration and firing the events instead of the main animations. These fake animations would always transition in cuts instead of crossfading. The big question in that case would be, if you can't see the relevant animation (eg. attack) playing to sync the event, why bother? True, better add any short delay manually.
Ideally, all events on all transitioning animations should be considered, always. Can you make a plight for us to get this changed, Rune? :)
Your answer
Follow this Question
Related Questions
Animator Layer executes when weight equals zero 1 Answer
Good design when starting animation and triggering event in animation? 2 Answers
Animation Event not working properly 0 Answers
Mecanim avatar masks don't work. 0 Answers
Animation Event Lag 0 Answers