- Home /
Playing sound when animation starts
Here's the thing:
I got one GameObject with animation, sound and script.
Script goes:
function Start () {
animation["Default Take"].wrapMode = WrapMode.Loop;
for (var state : AnimationState in animation) {
state.speed = -1;
}
animation.Play("Default Take");
}
So it just starts infinite loop of animation. Now what I want to do is to play sound whenever animation starts from the beggining (loop loops).
Comment
Answer by ExTheSea · Jun 16, 2012 at 09:49 PM
You could Add an event to the animation at the beginning which calls a function that plays the sound.