Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- //var prevCam : Camera;
- var thisCam : Camera;
- function OnTriggerEnter( other : Collider ) {
- Debug.Log(" Enter Trigger " + gameObject.name);
- Debug.Log("Other " + other.name);
- Debug.Log("Player " + other.tag);
- if ( other.CompareTag("Player") ) {
- Debug.Log("Triggered at " + gameObject.name + " for " + thisCam.gameObject.name);
- //prevCam.enabled = false;
- Camera.main.enabled = false;
- thisCam.enabled = true;
- if ( thisCam.animation != null ) {
- thisCam.animation.Stop();
- thisCam.animation.Rewind();
- thisCam.animation.Play();
- }
- }
- }
Add Comment
Please, Sign In to add comment