I’m a bit of a noob…
I’m using this script to animate an object and play a sound, the animation works fine but the sound is coming from the trigger not the animated object.
Any help is very much appreciated.
var Sound : AudioClip;
var Animator : GameObject;
private var hasPlayed = false;
function OnTriggerEnter(){
if(!hasPlayed){
audio.PlayOneShot(Sound);
hasPlayed = true;
Animator.animation.Play("plane");
}
}