how can i play sound at between different state of animation using mechanim or anymethod will bw appreciated
Hi.
You can use Animation Events.
- 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
}
- Create an Event in the needed frame of the needed animation by right-click mouse.
- 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