Search Unity

Oculus integration teleportation not working

Discussion in 'AR/VR (XR) Discussion' started by CWatsonT2, Mar 11, 2019.

  1. CWatsonT2

    CWatsonT2

    Joined:
    Jan 9, 2019
    Posts:
    13
    I'm using unity 2018.3.7f1 with the oculus integration 1.35. The teleportation demo scene is acting strange. When you teleport using the thumbstick it moves you to the desired spot then to another spot far behind where you started. In most cases it's so far back you fall off the ground plane. I've tried messing with all the components but haven't found anything that fixes it. Anyone else having this problem or know how to fix it?
     
    iliepandia likes this.
  2. dtrevillyan

    dtrevillyan

    Joined:
    Nov 16, 2018
    Posts:
    3
    I've been working with the Oculus teleportation recently in Unity 2018.2.17 and it seems to work fine. I believe I have the 1.35 in integration. Are you using the capacitive setting to trigger teleport? If so, could a finger too close to the button be triggering a teleport?
     
  3. CWatsonT2

    CWatsonT2

    Joined:
    Jan 9, 2019
    Posts:
    13
    I don't change anything in the demo scenes. However they are set up is how I leave it. It's strange because sometimes it teleports fine and the rest of the time it blasts me out into space. It doesn't seem to have anything to do with the capacitive setting. If I am really careful not to touch anything but the joystick it still happens.

    I did some more testing and it seems like a force is being applied to my playercontroller. I am unable to teleport out into the areas I am falling so I don't believe it is a accidental teleport. It's more like I'm colliding with something that's applying a huge horizontal force. I added walls surrounding the playspace and that keeps the playercontroller contained but it gets blasted back into the walls. Always horizontal though. Never vertically.
     
    Last edited: Mar 12, 2019
  4. CWatsonT2

    CWatsonT2

    Joined:
    Jan 9, 2019
    Posts:
    13
    So Unity 2018.2.0f2 works without the teleportation glitch. What didn't work was Unity 2018.3.0f2, 2018.3.8f1, 2018.3.7f1, and 2019.2.0a6. These all had the same teleport glitch.
     
  5. CWatsonT2

    CWatsonT2

    Joined:
    Jan 9, 2019
    Posts:
    13
    For now I am commenting out the following line in LocomotionTeleport.cs in the function DoTeleport(). This makes the glitch go away. I'm not sure yet if this is going to cause me any other problems but it gets me working for now.

    788| LocomotionController.PlayerController.Teleported = true;
     
    mafikes, Schneider21 and iliepandia like this.
  6. iliepandia

    iliepandia

    Joined:
    Jan 29, 2019
    Posts:
    3
    I have exprienced the same issue. For whatever reason some times it works sometimes I get that "push back effect" you mention. I also found that line and commented it out. But what happens is that sometimes I get teleported inside the geometry of the scene. So strange...

    Thanks for the tip about Unity versions.
     
  7. iliepandia

    iliepandia

    Joined:
    Jan 29, 2019
    Posts:
    3
    unity_SJVcEt-G9UO-uQ likes this.
  8. iliepandia

    iliepandia

    Joined:
    Jan 29, 2019
    Posts:
    3
    This bouncing problem seems to still be there in Unity 2019.1.3f1

    Did anyone figure it out :)?
     
    unity_SJVcEt-G9UO-uQ likes this.
  9. meken

    meken

    Joined:
    May 6, 2013
    Posts:
    2
    Thanks for that! You saved the day for me!
     
  10. Kyodan

    Kyodan

    Joined:
    Feb 5, 2015
    Posts:
    8
    You may want to increase the "Fixed Timestep" value (within the Unity editor, under the Edit -> Project Settings -> Time menu) to match the max framerate of your device. This value determines the rate at which your physics objects update; this is set to 0.2 as default within Unity (50Hz). You can refer to the following chart to determine which values to enter based on device:

    50Hz (Default) = 0.2
    60Hz (Gear VR) = 0.0167
    72Hz (Quest/Oculus Go) = 0.0138
    80Hz (Rift S) = 0.125
    90Hz (Rift) = 0.0111

    This not only makes the physics within your experience smoother, but it also solves the issues around teleporting.
     
  11. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    2,887
    I changed the Fixed Timestep as @Kyodan suggested, as well as commented out the line @CWatsonT2 pointed to. I no longer get the crazy bouncing around the scene, but I now have one last strange issue.

    When teleporting, my X and Z coordinates are correct, but if the point is lower in elevation than where I'm standing, the character controller is only shifted to a spot above the destination, and I'm then dropped down (which creates a pretty terrible sensation). This despite me modifying the LocomotionTeleport.cs script to even raycast to the ground and specifically place me at that point.

    Looking into the PlayerController a bit, it looks like that Teleported flag is used to prevent conflicting movements from interfering with each other (such as the movement of the HMD). So while having that not set to true prevents the bouncing, it looks like there's some sort of vertical movement that's now being inhibited because of it.

    Either of your guys experience this, or know of a potential workaround?
     
  12. blackfox_studio

    blackfox_studio

    Joined:
    Apr 8, 2019
    Posts:
    3
    I'm currently experiencing the same problem: when I teleport I randomly fall through the floor.
    I have tried:
    1) To change the fixed timestamp to several values: 1/90 (90Hz) or 1/72(72Hz)
    2) Using a thin cube instead of a plane for the floor.

    Nothing works.

    I'm using Unity 2019.1.9f1 with Oculus integration 1.38 and the teleport with parabolic handler and deploying on Oculus Quest
     
  13. irishladogreen

    irishladogreen

    Joined:
    Nov 24, 2017
    Posts:
    2

    That worked for me! (Unity version 2018.3.14) Thank you
     
  14. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    60
    I'm glad I'm not alone, same issue here on 2019.2.0f1 Whilst looking through the Oculus dev docs I did notice this...

    https://developer.oculus.com/documentation/unity/latest/concepts/unity-req/

    Recommended Unity Versions
    We recommend using one of the following Unity versions for all Oculus development.
    • 2017.4 LTS
    • 2018.4 LTS
    • 2019.1.2f1
    Not tried with those specific versions but looks like they test against those and probably be ok there?
     
  15. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    2,887
    You might think that, but I've tried with those specific versions (2018.4 LTS and 2019.1.2f1) and this same issue -- along with many others -- are present. As much as I enjoy my Oculus headsets and the software that runs on them, the Unity integration is pretty trash.

    Honestly, the best thing I've found to do is use the Oculus-provided code only as a reference and example, and write your own scripts with a form of implementation of the features you want. There's just so many parts and dependencies to the Oculus stuff that it breaks too easily.
     
  16. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    60
    @Schneider21 Thats disappointing to hear regarding the specific versions with the same issues. I spent quite a bit of time just working out I needed to enter an App ID in the Oculus settings due to recent change as well regarding Avatars. Before that I couldn't get any teleporting to work at all.

    Generally I'm having a really confusing time of stuff with Unity and VR with my Rift and have just started another post in the VR forum to try and get some help around it all. I honestly came into Unity expecting VR on-boarding, best practises and getting started to be pretty smooth but for me it hasn't been at all :(
     
  17. pixeleif

    pixeleif

    Joined:
    Feb 9, 2016
    Posts:
    5
    Thank you so much for this. I've been absolutely wrecking my brain trying to figure out why i get the push back effect for 2.5 days! Tried mulitple versions of unity with the different Oculus Integration versions...

    2018.2.0f2, Oculus Integration 1.35 and misc tries with java sdk's and androids sdk's later I've finally got it!
    You are a life saver!! :)
     
  18. JasperCiti

    JasperCiti

    Joined:
    Jul 5, 2013
    Posts:
    2
    The Oculus Integration 1.40 includes a "Character Camera Constraint" script that you need to add to the same GameObject that contains your "OVR Player Controller". This took care of the above mentioned issue for me on Unity 2019.2.4f
     
  19. Debashishb06

    Debashishb06

    Joined:
    Feb 7, 2013
    Posts:
    3
    Just Replace to this script, this script working perfectly i am just doing the CharacterController disable on pre-teleport and enable the post-teleport on DoTeleport method line no.761
     

    Attached Files:

    tktktktktk and Arlorean like this.