Search Unity

Issue with XRI while trying to set up a lever

Discussion in 'VR' started by ctherndon, May 7, 2020.

  1. ctherndon

    ctherndon

    Joined:
    Aug 22, 2015
    Posts:
    10
    upload_2020-5-7_15-16-32.png

    Hi all, I have the above lever configured with the XRI DialInteractable. I would expect the Gizmo to mean that the rotational limits I have set up are within the red area so it can go 90 degrees forward and 90 degrees backward.

    However the current behavior is that it can go 180 degrees in the forward direction only.

    upload_2020-5-7_15-19-30.png


    Is this expected behavior or is something not working correctly?

    Is there a better way to handle this type of lever with the XRI?

    Another issue I'm experiencing is it seems my steps are not getting called.

    upload_2020-5-7_15-21-27.png


    ^ sets the dial step changed to

    public void RotateObj(int step)
    {
    switch (step)
    {
    case 0:
    rotDir = Vector3.up;
    Debug.Log("Case 0");
    break;
    case 1:
    rotDir = Vector3.zero;
    Debug.Log("Case 1");
    break;
    case 2:
    rotDir = Vector3.down;
    Debug.Log("Case 2");
    break;
    default:
    Debug.Log("Step changed");
    break;
    }
    }

    none of the above case steps get printed out.


    EDITS:

    UPDATE #1 5:00 p.m.
    Regarding the steps not getting called,
    I fixed the steps not getting called by commenting out the sfx code. Which throws an error even if you have a sound selected in the dial interactable component
    /*
    SFXPlayer.Instance.PlaySFX(SnapAudioClip, transform.position, new SFXPlayer.PlayParameters()
    {
    Pitch = UnityEngine.Random.Range(0.9f, 1.1f),
    SourceID = -1,
    Volume = 1.0f
    }, 0.0f);
    */
    I am still experiencing an issue with rotational limits
     
    Last edited: May 7, 2020