Hi guys!
I need some help with this script I’m trying to write, it’s the first time I’ve had to write a script so I am really winging it.
It’s meant to trigger an animation on collision and switch cameras from camera 1 to camera 2, the animation part works fine, it’s just the camera part I’m stuck with, help me pretty please?
var ride :GameObject;
var Camera1 :Camera;
var Camera2 :Camera;
function OnTriggerEnter (col : Collider) {
if(col.gameObject.tag == "Player") {
ride.animation.Play();
Destroy(gameObject);
Camera1.enabled = false;
Camera2.enabled = true;
}
}