Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Change something (Collider or the Tag) in the Collision code the sound works but if left as they are Sound doesn't work but the Duck is destroyed
- ---------------------------------Collision Code--------------------------------------
- function OnTriggerEnter( hit : Collider ) {
- if(hit.gameObject.tag == "Bullet")
- {
- Destroy(gameObject);
- }
- }
- ---------------------------------Death Code (sound)--------------------------------------
- var mySound : AudioClip;
- function OnTriggerEnter(hit : Collider)
- {
- if(hit.gameObject.tag == "Bullet")
- {
- audio.PlayOneShot(mySound);
- }
- }
Add Comment
Please, Sign In to add comment