can any1 tell me about code that this unity tutorial give about pinch to zoom, there's a code like camera.isOtographic, camera.ortographicSize, camera.fieldOfView. But I can't use that all, not even find at the autotext too. Can any1 explain it what that code related, or how to use that code ?? Thanks anyways
yea I see that tutorial but I can't even understand camera.isOrtographic, when I try it at script there's no isOrtographic at autotext. That's why I go to here, maybe u can explain it ??
It's not a method, its a bool Property, make it = to true for Ortographic mode or false for perspective. Also what are you trying to run it on, you need a Camera Object, you cant just run it on the class since its a instance member not a static memeber.
hhmm my unity detect it change obselete API then, my script change automatically into this and this is still the same script that unity tutorial give about pinch. I'm not attach all the script I attach just the last script that change because of API. from the first if till last script. Code (CSharp): if (GetComponent<Camera>()) { // ... change the orthographic size based on the change in distance between the touches. GetComponent<Camera>().orthographicSize += deltaMagnitudeDiff * orthoZoomSpeed; // Make sure the orthographic size never drops below zero. GetComponent<Camera>().orthographicSize = Mathf.Max(GetComponent<Camera>().orthographicSize, 0.1f); } else { // Otherwise change the field of view based on the change in distance between the touches. GetComponent<Camera>().fieldOfView += deltaMagnitudeDiff * perspectiveZoomSpeed; // Clamp the field of view to make sure it's between 0 and 180. GetComponent<Camera>().fieldOfView = Mathf.Clamp(GetComponent<Camera>().fieldOfView, 0.1f, 179.9f); } }