Search Unity

I want to make some delay or latency in virtual reality

Discussion in 'AR/VR (XR) Discussion' started by hyeobchoi, Jul 22, 2016.

  1. hyeobchoi

    hyeobchoi

    Joined:
    Jul 22, 2016
    Posts:
    5
    Hello

    I am using a HMD(Vive) and I want to make some delay in my VR.

    (simply speaking, if I turn my head, then the scene from HMD changes after few seconds)

    I opened some scripts of SteamVR plugin (SteamVR_GameView.cs, SteamVR_TrackedObjects.cs, etc...)

    and I tried WaitForSeconds function, but it did not work.

    I am a beginner for unity and C#.

    If you have any ideas or comments, please reply.

    All small comments, suggestions and advices will be very helpfull to me.

    Thank you.
     
  2. hyeobchoi

    hyeobchoi

    Joined:
    Jul 22, 2016
    Posts:
    5
    The scene changes as same as my head movement few seconds before
    (movement of head(real) in 0~5s <-sync-> movement of scene in 5~10s , program start : 0s)
     
  3. TDArlt

    TDArlt

    Joined:
    May 22, 2013
    Posts:
    23
    Just one quick idea: You could add a camera that isn't controlled by the HMD and let the player only see that one.
    Then, you store the transform information of the HMD and apply it with a delay to the camera the player sees.
     
  4. hyeobchoi

    hyeobchoi

    Joined:
    Jul 22, 2016
    Posts:
    5
    Um.. but, I want to use the HMD to see the scene, so it will be better to use SteamVR plugin and its scene
     
  5. Desutoroiya

    Desutoroiya

    Joined:
    Apr 26, 2016
    Posts:
    12
    I don't know if it is a good idea to delay the movement. Except if you want people to get motion sickness.
     
  6. Quen

    Quen

    Joined:
    Apr 6, 2010
    Posts:
    21
    And they will get sick! The only question is: How strong will thier sickness be?

    We had a project 5-6 years ago, doing exactly the same, to find out if there is a certain type of people who are more resistant to motion sickness. Short answer: no :cool:

    But our project was done with the Blender game engine. So I can't help with the technical problem here :(

    Just one hint: If you let people use your VR with an intended delay, you are intentionally "hurting" them because you make them sick on purpose. Check the law in your country and make sure people agree to that "hurt".
     
  7. naomi_k

    naomi_k

    Joined:
    Jan 23, 2020
    Posts:
    24
    Sorry to open up an old forum but did anyone end up figuring out how to accomplish this?
     
  8. mcmount

    mcmount

    Joined:
    Nov 15, 2015
    Posts:
    83
    As you can't manipulate the camera directly, you do it with the rig.

    You could try this:
    First you need to store your hmd position & rotation delayed, so you update 2 vector3 constantly. Create an array for it and store on every frame; 1 second, atleast 90 items per second. Window back to 3 seconds would mean 240 lines in array. Your first item is your delayed info. Adding new item means deleting the first item. Not maybe the most efficient way, but could work.

    Next, create dummy object, set the location according your camera. In every frame you reparent your whole rig to the dummy and apply the first item to change the rotation & position of the dummy. You might need to invert the rotation values. Then remove the rig from the parent.

    If you want to compensate the current hmd rotation, you need to subtract the rotation vectors.

    But no matter how it's done, it makes you really sick.
     
  9. Dynacored

    Dynacored

    Joined:
    Dec 11, 2021
    Posts:
    1

    @hyeobchoi did u find a solution for unity?