// Update is called once per frame void Update() { float forwardX = Target.position.x + Lead; float targetX = Mathf.Max((forwardX * 2 + IsoUtils.ScreenToIso(Input.mousePosition).x) / 3, forwardX); transform.position = Vector3.Lerp(transform.position, new Vector3(targetX, transform.position.y, transform.position.z), Time.deltaTime * MaxSpeed); }