so what I want is if a player walks into a 2d box collider (with trigger on) the camera has to change
However when I attach this script to the object with the 2d box collider (which has trigger enabled)
Nothing happens! what is wrong?
#pragma strict
var FPScamera : Camera;
var TPcamera : Camera;
function OnTriggerEnter2D (other : Collider2D)
{
FPScamera.GetComponent.<Camera>().enabled = false;
TPcamera.GetComponent.<Camera>().enabled = true;
}
function OnTriggerExit2D (other : Collider2D)
{
FPScamera.GetComponent.<Camera>().enabled = true;
TPcamera.GetComponent.<Camera>().enabled = false;
}