- Home /
Camera FOV is adjustable in editor but not in Android Phone build (Google VR 1.6 and Unity 5.6.1f1)
I found a C# script on how to adjust the FOV of the camera In-game, it works in the editor but when I build it and played it on my Android phone the script doesn't work anymore. Anyone having this problem? Here's the script
public class CameraZoom : MonoBehaviour { // public Camera caml; public float zoomSpeed = 20f; public float minZoomFOV = 10f; public float maxZoomFOV = 60f; public bool zoomedIn = false; //boolean that determines whether we are in zoomed in state or not void Update () { if (Input.GetButtonDown ("Fire3")) {//(Input.GetKeyDown("z"))//This function toggles zoom capabilities with the Z key. If it's zoomed in, it will zoom out
zoomedIn = !zoomedIn;
}
if (zoomedIn == true) {
caml.fieldOfView -= zoomSpeed/8;
//Camera.main.fieldOfView -= zoomSpeed/8;
if (caml.fieldOfView < minZoomFOV)
{
caml.fieldOfView = minZoomFOV;
}
}
else
{
caml.fieldOfView = maxZoomFOV;
}
}
}
Answer by bean-man · Dec 20, 2021 at 07:35 PM
Bump, still happening in 2019.4.29f1. Anyone have any solution?
Your answer
Follow this Question
Related Questions
unity vr app build for android, stuck at one point 0 Answers
Gradle build fail Unity 0 Answers
How can i connect the smartphone's photogallery with app just build? 0 Answers
Unity Android Build Dosn't Work On The Device But Works In The Editor. 0 Answers
Google Cardboard VR Project Says Pixel Phone is Not Compatible Device 1 Answer