i need help with a script who when i playing and i stay in a range i can activate with a key a camera switcher this is the script, but this script not work, pleaSe help me!!
Vector3 camPosition;
Vector3 myPosition;
int range = 10;
if(Vector3.Distance(myPosition, camPosition) < range)
{
if(Input.GetKeyDown("1"))
{
cam1.enabled = true;
cam2.enabled = false;
}
if(Input.GetKeyDown("2")){
cam1.enabled = false;
cam2.enabled = true;
}
}
↧