При перемещении камеры с помощью Touch она передвигается не плавно.
private Touch touch;
public float speed = 0.01f;
//public float speedFinal = 60f;
public GameObject mainScriptObject;
private MainScript mainScript;
void Start()
{
mainScript = mainScriptObject.GetComponent<MainScript>();
}
void Update()
{
if (Input.touchCount > 0 && !mainScript.isFreezed)
{
touch = Input.GetTouch(0);
if (touch.phase == TouchPhase.Moved)
{
transform.position = new Vector3(
Mathf.Clamp(transform.position.x - touch.deltaPosition.x * speed, -100.0f, 100.0f),
transform.position.y,
Mathf.Clamp(transform.position.z - touch.deltaPosition.y * speed, -100.0f, 100.0f));
}
}
}