public Vector2 GetAxis(EVRButtonId buttonId = EVRButtonId.k_EButton_SteamVR_Touchpad) { Update(); var axisId = (uint)buttonId - (uint)EVRButtonId.k_EButton_Axis0; return new Vector2(state.rAxis[axisId].x, state.rAxis[axisId].y); }
void Update() { //Set device equal to the tracked controller device = SteamVR_Controller.Input((int)trackedObject.index); //Store touchpad y axis in local variable touchpadY = device.GetAxis().y; touchpadX = device.GetAxis().x; if (isNoCollison) { //If touchpad is touched in top half movePlayer(); } else { if (touchpadY < 0) //Player can only move backwards { movePlayer(); } else { Debug.Log("STILL STUCK"); } } }