|
I would like to have a audio clip play as something goes though a collider like this object which is a robot (which has the name car) and when it falls in the pit i have a audio snip it so when it passes the collision it will play is there away to do that? so like it has a gameobject which has a cube collider and when the robot passes it when it falls in the pit it activates the audio?
(comments are locked)
|
var audio2 : AudioClip; function OnTriggerEnter (other : Collider) { if (other.tag == "Car"){ audio.clip = audio1; audio.Play(); } } But it plays for all objects the passes the collider Your code isn't formatted well here, but I'm noticing that you have an if, but no else. You might want one.
Aug 08 '12 at 10:54 PM
Screenhog
(comments are locked)
|
