Advertisement
Guest User

Untitled

a guest
May 29th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. songarea = Resources.Load ("Song Name") as AudioClip;
  2.  function OnTriggerEnter (other : Collider)
  3.     {
  4.         {
  5.             if (other.gameObject.tag == "Player")
  6.             {
  7.                 Song = object.GetComponent<AudioSource>();
  8.                 Song.clip = songarea
  9.                 Song.Play();
  10.  
  11.             }
  12.         }
  13.     }
  14. @script RequireComponent(AudioSource)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement