I have a script that changes the 2D view into a 3D view (and 3D view into 2D view), here's the script -
function Update ()
{
if(Input.GetKey("1"))
{
GetComponent("SmoothFollow").distance = 0.0;
GetComponent("SmoothFollow").height = 20.0;
GetComponent("SmoothFollow").heightDamping = 0.0;
GetComponent("SmoothFollow").rotationDamping = 0.0;
}
if(Input.GetKey("2"))
{
GetComponent("SmoothFollow").distance = 10.0;
GetComponent("SmoothFollow").height = 5.0;
GetComponent("SmoothFollow").heightDamping = 2.0;
GetComponent("SmoothFollow").rotationDamping = 0.0;
}
if(Input.GetKey("p"))
{
GetComponent("SmoothFollow").height += 1.0;
}
if(Input.GetKey("l"))
{
GetComponent("SmoothFollow").height -= 1.0;
}
}
as you can see I'm trying to change the var's of the standerd asset script, SmoothFollow, and I add this script to the cameras in my scenes, but it doesn't work except for this one camera in one of my scenes. Please help me!