Animation event fires three times on the first frame - is this a known issue?

Howdy, I have an animation with an event on the second frame and one on the last frame. The function that the events trigger takes an AnimationEvent as a parameter and prints the time that the event is triggered.

Triggering the animation gives this result:

[27399-2014-06-07+10_47_43-clipboard.jpg|27399]

which is exactly what I would expect.

What I really want is to have the first event to be on the first frame, but when I move that event onto the first frame (so there is just one event on the first frame and one on the last) I get this result:

[27400-2014-06-07+10_48_47-clipboard.jpg|27400]

As you can see, the function is triggered 4 times. Twice at the beginning, once at the end, and once at the beginning again. I’m not doing anything different other than moving the event between the second and first frames and the animation plays normally both times.

Has anyone had the same problem?

The function just looks like this:

function PrintTime(animEvent : AnimationEvent)
{
	print(animEvent.time);
}

Thanks very much,

Romano

edit: I’m using Unity 4.5 and haven’t tried using animation events before this.

If your animation is on the default state of your animator it will play when it wakes up. Set your default state to one without an anim on it. The default state is the orange one.