- Home /
how to get axis/touchpad input in webvr???
I have this script which uses mouse input to change fov, im trying to get it done through axis/trackpad of controllers (via WEBVR- i think which uses gamepad api?) , please point to right direction, i wasn't able to find any page or example on search.
using System.Collections;
public class Mousewheelzoom : MonoBehaviour {
float minFov = 55f;
float maxFov = 180f;
float sensitivity = 225f;
void Update (){
WebVRController controller = gameObject.GetComponent<WebVRController>();
float fov = GetComponent().fieldOfView;
fov += Input.GetAxis("Mouse ScrollWheel") * sensitivity;
// fov += controller.Axis2D.PrimaryThumbstick;
fov = Mathf.Clamp(fov, minFov, maxFov);
GetComponent().fieldOfView = fov;
}
}
Comment