Jump to content

Tumbstick not working with Focus 3 & Unity


Recommended Posts

Hello everyone !

We are playing with our new Focus 3, it's a nice headset but in our Unity App we can't get to access Joytick data on controlers. Buttons inputs works fine but no axis data. As our moving system is based on axis input, we can't get our app to run correctly.

We tried with Unity Input system and Wave SDK, nothing to do it doesn't work.


Here is our basic script (translation only) :

public class PlayerController : MonoBehaviour
    VRControls controls;

    public Rigidbody Player;
    public enum ControlerType { ViveFocus3, OculusTouch, Gamepad, Hands }
    public ControlerType controlertype;

    [Range(2.0f, 20.0f)]
    public float Sensibility = 5.0f;

    public Vector2 translate;
    public Vector2 rotate;

    void Start()
         controls = new VRControls();

    void FixedUpdate()
        controls.ViveFocus3.Movement.performed += cntxt => translate = cntxt.ReadValue<Vector2>();
        controls.ViveFocus3.Movement.canceled += cntxt => translate = Vector2.zero;

        controls.ViveFocus3.Rotation.performed += cntxt => rotate = cntxt.ReadValue<Vector2>();
        controls.ViveFocus3.Movement.canceled += cntxt => rotate = Vector2.zero;

       // translate = WXRDevice.ButtonAxis(Wave.Native.WVR_DeviceType.WVR_DeviceType_Controller_Right, Wave.Native.WVR_InputId.WVR_InputId_Alias1_Thumbstick);

        Vector3 translation = new Vector3(translate.x * Sensibility, 0, translate.y * Sensibility);
        Player.velocity = translation;

translate vector is linked to right thumbstick axis input in unity input system. We also put the code in an Awake method, not working.


Thanks !

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...