have problem using this script on differents buttons, when i touch one button it seam that i touch all the buttons at same time.
what i want is to have a generic script to set diferent cameras for diferent buttons using same script.
var Main_camera : Transform;
var GoToCamera: Transform;
function Update(){
if(Input.touchCount > 0)
{
var hit : RaycastHit;
var vektor = Vector3(Input.GetTouch(0).position.x,Input.GetTouch(0).position.y,0f);
var ray : Ray = Camera.main.ScreenPointToRay (vektor);
if (Physics.Raycast(ray, hit, Mathf.Infinity))
{
Main_camera.position = Vector3.Lerp(Main_camera.position, GoToCamera.position, Time.deltaTime * 4);
}
}
}