Guest User

Untitled

a guest
Jul 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #pragma strict
  3.  
  4.  //var prevCam : Camera;
  5.  var thisCam : Camera;
  6.  
  7. function OnTriggerEnter( other : Collider ) {
  8.    
  9.     Debug.Log(" Enter Trigger " + gameObject.name);
  10.    
  11.     Debug.Log("Other " + other.name);
  12.     Debug.Log("Player " + other.tag);
  13.    
  14.     if ( other.CompareTag("Player") ) {
  15.         Debug.Log("Triggered at " + gameObject.name + " for " + thisCam.gameObject.name);
  16.         //prevCam.enabled = false;
  17.         Camera.main.enabled = false;
  18.         thisCam.enabled = true;
  19.        
  20.         if ( thisCam.animation != null ) {
  21.             thisCam.animation.Stop();
  22.             thisCam.animation.Rewind();
  23.             thisCam.animation.Play();
  24.         }
  25.     }
  26.    
  27. }
Add Comment
Please, Sign In to add comment