Search Unity

Unity XR Interaction Toolkit Preview Release

Discussion in 'AR/VR (XR) Discussion' started by mfuad, Dec 17, 2019.

  1. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    671
    I am using the UI as a pause menu for my game and I noticed on occasion that the XR Ray Interactor doesn't always find the UI, it is quite temperamental. I have a reproduction project I can share for this but it is quite large so might make a smaller one. On occasion when loading into a scene for the first time, the raycasters won't immediately find the UI, requiring me to walk about or turn with the analogue stick for a while to get the ray casters to interact.

    Shall I report a bug for this?
     
  2. StayTalm_Unity

    StayTalm_Unity

    Unity Technologies

    Joined:
    May 3, 2017
    Posts:
    135
    @ROBYER1
    Yes, please file a bug, so I can track it properly.
    First instinct is that it has to do with the Ray Interactor being enabled already looking at a UI object, but I'll definitely have to dig in, I wrote the whole Ray-UI stuff, and don't doubt it still has a couple little bugs hidden in there somewhere.
     
    Last edited: Feb 12, 2020
    ROBYER1 likes this.
  3. linojon

    linojon

    Joined:
    Aug 25, 2014
    Posts:
    90
    hi. The Ray Interactor has an Enable Interaction with UI GameObjects checkbox, and the Direct Interactor does not. I can implement direct interactions manually by adding a XR Simple Interactable, constraining the Rigidbody, and adding a Collider to the button ui object, and wiring the xr events into the button Select() for example. Is better UI interaction planned with Direct Interactor?
     
  4. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    432
    Will the XR Interaction toolkit supply a way of interacting with a VR input field?
    At this point we have an own made VR Keyboard, which works kind of, but of course the input field loses focus when interacting on the virtual keyboard.
     
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    5,860
    briefly tested the example scene (on oculus using quest with link)

    issue:
    when trying to throw those cubes (any of those 3 types),
    there is like 0.5s delay before the cube is released and flies away.. (and it feels stuck on release, instead of properly following the velocity).
     
  6. Matt_D_work

    Matt_D_work

    Unity Technologies

    Joined:
    Nov 30, 2016
    Posts:
    113
    curious. it _should_ be fine. raise a bug (and take a video if you can!)
     
  7. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    5,860
    i noticed that adjusting this value to 0.99 helps, but then picking up requires full press or something:
    upload_2020-2-15_0-38-14.png

    *Comparing this to SteamVR interaction demo scene, where throwing those cubes feels more natural / responsive.

    But ill test a bit more first.

    *some improvement if removed all the smoothing from cube,
    upload_2020-2-15_21-3-27.png

    Small video clip, compared box handling in SteamVR (but not that clearly visible in video..)


    Comparison:
    XRKit: With slow movement: box stuttering, With fast movement: box lags behind, not perfectly following
    SteamVR: Smooth movement, fast follow (since its parented)

    (maybe due to the box is not parented to hand in xr kit? or some other settings..)
     
    Last edited: Feb 16, 2020
  8. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    671
    Using the Standalone Input Module from the new Unity Input system causes the UI input module to misbehave.. and by misbehave I mean that if a Raycaster is aimed at the UI and you move or turn, it gets stuck with the UI. Most strange!
    upload_2020-2-17_10-30-32.png
     
  9. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    81
    From your screenshot, you are not using the InputModule from the new InputSystem, StandaloneInputModule is from the old InputManager.
     
  10. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    671
    I'm aware of that but the component being there regardless of using legacy or new input system seems to interfere, just took the screengrab after I reverted to legacy input
     
  11. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    671
    @StayTalm_Unity Terrain placed trees seem to always receive the teleporter raycast, nomatter what I do with their layer

    This has been reported at (Case 1220974) [XR Interaction Toolkit] Terrain Trees are picked up by XR Raycasters for Teleporting
     
    Last edited: Feb 18, 2020 at 4:43 PM
    Matt_D_work likes this.
  12. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    671
    I'm feeling nice and sharing this for anyone looking to set up a free locomotion character controller for XR Rig, it's a mishmash of my own logic, the logic in OVRPlayer Controller and Unity Examples FPS Character controller, the name of it is a bit of a lie as it doesn't use Rigidbody, it uses the Character Controller component. I won't be able to help people much with it but take what you want from it and comment out anything you don't need. It takes the form of a LocomotionProvider and has free movement. I cannot state enough that it is not a drag and drop solution, it has references to things that you won't have or need so just delete them, also the Input is referencing the standard Unity input system mostly so you can adapt it to your own needs by providing the 'GetInput' function at the bottom of the script with your own input values :)

    Happy Free-Look locomotion and I'm interested if anyone can improve it for me also ;)

    There is also some floating point math glitch if you are exactly at 0,0,0 in the world with it where your head will jolt a bit, if you find it annoying replace line 170 and so on with this where it says something similar


    Code (CSharp):
    1.         if (Mathf.Round(CurrentDistance * 10) / 10 > 0)
    2.             {
    3.                 headsetOffset.position = oldCameraPos - delta;
    4.             }
     

    Attached Files:

    Last edited: Feb 19, 2020 at 6:52 PM
  13. UXVirtual

    UXVirtual

    Joined:
    Jan 28, 2016
    Posts:
    1
    Excellent, keen to give this a go. Currently working on a physics sandbox demo with support for climbing, projectile weapons etc so implementing a free-look locomotion system will be useful.
     
    ROBYER1 likes this.
  14. Matt_D_work

    Matt_D_work

    Unity Technologies

    Joined:
    Nov 30, 2016
    Posts:
    113
    that's due to the way that we use the physics system to move the object. its something we're thinking of ways to minimize. having the physics timestep the same as your framerate certainly helps tho!.
     
  15. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    671
    Drop me a message about it if you have any questions!

    If anyone else wants to collaborate on it or has issues/improvements to suggest, tag me in another forum post about it.
    I don't want to distract from conversation about XR Interaction package here!

    @Matt_D_work I didn't check if detail meshes also are included in the terrain raycast layer much like the trees issue I reported above but it is safe to assume they are also included. Will there be a workaround for this?

    Currently my playtesters are teleporting up trees which is not ideal and we need to use terrain object instancing for Oculus Quest performance reasons. There are of course workarounds but if the terrain is changing during development it adds quite a lot of extra dev time!
     
  16. seltar_

    seltar_

    Joined:
    Apr 16, 2015
    Posts:
    15
    Is there a way to trigger the Select action on the XRController via script?
    It seems all the fields and methods required to do so are private / internal.
     
unityunity