- Home /
Question by
tatsuya1970 · Apr 13, 2014 at 03:19 PM ·
audioaudioplayaudio clip
I have an error "Can not play a disabled audio source"
Hello, I want to play the sound.
but, there is an error
"can not play a disabled audio source."
how can i fix it?
This is a my script.
What's wrong whit this script?
Please teach it to me.
#pragma strict
var clip1:AudioSource;
var projectile : GameObject;
function OnCollisionEnter(collisionInfo : Collision) {
if (collisionInfo.gameObject.tag == "enemy") {
clip1.Play();
Destroy(collisionInfo.gameObject);
var clone : GameObject = Instantiate(projectile, transform.position, transform.rotation) as GameObject;
Destroy(clone.gameObject, 0.5);
}
Destroy(gameObject);
}
Comment
Your answer
Follow this Question
Related Questions
Change Pitch on Collision 1 Answer
Can not play a disabled audio source 2 Answers
Boolean and audio is not working right 1 Answer
Play back multi channel audio 0 Answers
How to play music/audio 2 Answers