From a8a4490a68204fa6c5f074dce5c02b119b198014 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Aug 2015 20:13:51 -0400 Subject: [PATCH] sphere zooming exception if on the right side of the screen --- Assets/Scripts/NetworkingSphere.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/NetworkingSphere.cs b/Assets/Scripts/NetworkingSphere.cs index 9ab14a9..e65d092 100644 --- a/Assets/Scripts/NetworkingSphere.cs +++ b/Assets/Scripts/NetworkingSphere.cs @@ -72,7 +72,11 @@ public class NetworkingSphere : MonoBehaviour //scroll if (Input.GetAxis("Mouse ScrollWheel") != 0) { - Camera.main.fieldOfView += Input.GetAxis("Mouse ScrollWheel") * 10f; + // if (Camera.main.ScreenToViewportPoint(Input.mousePosition) < new Vector3(1,1,1)) + if (Camera.main.ScreenToViewportPoint(Input.mousePosition).x < 1) + { + Camera.main.fieldOfView += Input.GetAxis("Mouse ScrollWheel") * 10f; + } } }