noob question help needed animation with sound

how can i play sound at between different state of animation using mechanim or anymethod will bw appreciated

Hi.
You can use Animation Events.

  1. Create Script and add it to the animated object.

EventScript.js

#pragma strict
function Start () {
}
function Update () {
}
function PlayMyAudio(audio:AudioClip){
GetComponent.().clip=audio;
GetComponent.().Play();
GetComponent.().time=42; //play starting from 42 seconds
}

  1. Create an Event in the needed frame of the needed animation by right-click mouse.

  1. Set Event function and parameter (audio clip).

That’s all.

2 Likes

sir you are LOve

Five years later, this reply is still GOLD. Thanks!

1 Like