Ejemplo n.º 1
0
    private void LateUpdate()
    {
        Vector3 tempPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);

        tempPosition.z = 0f;
        if ((tempPosition - transform.position).sqrMagnitude > 30f * 30f)
        {
            transform.position = tempPosition;
        }
        else
        {
            transform.position += (Vector3)MoveComponent.Follow(tempPosition, transform.position, Camera.main.orthographicSize / 3f);
            // at original camera size (15) its 5 meters per frame
        }
    }