Search Unity

  1. Unity wants to learn about your experiences working on a Unity project today. We'd like to hear from you via this survey.
    Dismiss Notice
  2. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice
  3. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

UI on Controller: delay in movement.

Discussion in 'AR/VR (XR) Discussion' started by Marc-Saubion, Dec 17, 2016.

  1. Marc-Saubion

    Marc-Saubion

    Joined:
    Jul 6, 2011
    Posts:
    476
    Hi everyone.

    I'm currently working on a VR project for the HTC Vive where I use a palette type menu like this one parented on my left controller. My menu works fine but the UI follow it's controller parent with a slight delay in a smooth follow fashion. Note that I also display 3D meshes in some buttons but they aren't affected by this delay.

    I looked it up and find this thread mentioning UI should have a follow function with LateUpdate, which I tried instead of parenting but without success.

    Last test is parenting all my UI on a game object, and having it lateupdate-follow my controller: with that solution I still have the delay but on the whole thing meaning my UI and models don't intersect with movement. If I make that gameobject the new controller mesh, I have a plan B but the delay issue remains.

    Has anyone encountered this problem? I tried searching but the keywords are very common. My theory is that the controllers are already managed in lateupdate and prevent the UI position to be set after them but I didn't find any menus where I could set this properly.

    Thanks to anyone that can help.
     
  2. Marc-Saubion

    Marc-Saubion

    Joined:
    Jul 6, 2011
    Posts:
    476
  3. SolleXelloS

    SolleXelloS

    Joined:
    Aug 30, 2010
    Posts:
    16
    I don't have a vive to test this but my suggestion would be to attach a script to the controller to figure out the difference from last to current position (May have to test Update vs LateUpdate) and apply the offset to the transform of the canvas you wish to parent. (May want anchor the canvas to an empty holder gameobject so you can switch out menus)
    LMK your results please
     
  4. Marc-Saubion

    Marc-Saubion

    Joined:
    Jul 6, 2011
    Posts:
    476
    Thanks for your reply.

    The issue is, there is no actual delay in the worldspace. It comes after, during the rendering and that's not something I have access to. :-/
     
  5. Tinz

    Tinz

    Joined:
    Oct 11, 2015
    Posts:
    1
    I think there's some wizardry to apply the movement of the controllers as late as possible that doesn't work with a Canvas. My solution is to not parent the canvas to the controller. Instead, I use an anchor point that is a child of the controller. A simple script sets the position of the GameObject, that is the parent of the Canvas, manually to be the same as the anchor point.
     
  6. Dknighter2

    Dknighter2

    Joined:
    Aug 17, 2014
    Posts:
    27
    Go into the SteamVR Pose Updater and change the method from PreCull to PostUpdate. Worked for me.
     
    Crevecoeur and michaltakac like this.
  7. cart

    cart

    Joined:
    Oct 16, 2015
    Posts:
    2
    That works for me.

    Change OnPreCull to LateUpdate() in SteamVR_UpdatePoses.cs file.

    btw, my untiy version is 5.4.4f1.

    Thank you very much.
     
  8. bartburkhardt-sim-ci

    bartburkhardt-sim-ci

    Joined:
    Aug 21, 2017
    Posts:
    6
    SteamVR_UpdatePoses.cs is not being used anymore. Problem still exists unfortunately.
     
    vrdev004 likes this.
  9. btwist

    btwist

    Joined:
    Jan 3, 2019
    Posts:
    2
    Any news on this in the last years? we have this problem too
     
  10. NamrataKoirala

    NamrataKoirala

    Joined:
    Dec 9, 2020
    Posts:
    7
    Hi, there how did you make the palette type menu as shown in the comment above? I have also the same requirement like this so can you please share your work if possible?
     
unityunity