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:
    114
    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:
    114
    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:
    114
    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:
    114
    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;
     
  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:
    4
    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:
    3,512
    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:
    40
    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. babbel-ford

    babbel-ford

    Joined:
    Nov 24, 2017
    Posts:
    9

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

    appymedia

    Joined:
    May 22, 2013
    Posts:
    95
    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:
    3,512
    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.
     
    TimeWalk-org likes this.
  16. appymedia

    appymedia

    Joined:
    May 22, 2013
    Posts:
    95
    @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:
    17
    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:
    17
    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
     
    Lululatortue likes this.
  19. Debashishb06

    Debashishb06

    Joined:
    Feb 7, 2013
    Posts:
    8
    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:

    samra2494, LDEV_, Rickmanx72 and 4 others like this.
  20. Guitool

    Guitool

    Joined:
    Sep 29, 2016
    Posts:
    4
    Not sure if it's the same teleport glitch, but i have serious issue with teleportation, even with the sample framework locomotion scene : aiming is good, but my Player Controller is systematically pushed backward. I use Oculus integration 1.40 with Unity 2019.2.2f1. I'm trying to upgrade to the latest 2019.2.6f1... fingers crossed...
     
    Last edited: Sep 25, 2019
  21. Guitool

    Guitool

    Joined:
    Sep 29, 2016
    Posts:
    4
    Before trying to use the Oculus locomotion sample and scripts, i've tried the VRTeleporter asset from Unity store, with the same results : aiming is good but teleportation move my player backward. I was disappointed because VRTeleporter seems a simpler way to address teleportation. But even after used Oculus framework teleportation scripts, same systematic behaviour.

    Please share your advises, i don't find much posts about this problem. I probably do something wrong but i can't figure out what.

    Thanks
     
    Last edited: Sep 25, 2019
    Debashishb06 likes this.
  22. Guitool

    Guitool

    Joined:
    Sep 29, 2016
    Posts:
    4
    After upgrading to 2019.2.6f1, i've the same problem as illustrated in the following video capture.



    Any ideas ?
     
    Last edited: Sep 25, 2019
  23. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    243
    The first comment above your 3 comments has the solution (it fixed it for me anyway)
     
  24. Arealight

    Arealight

    Joined:
    May 4, 2017
    Posts:
    29
    The Teleport fix didnt fix the Arrow rotation is also backward. Anyone know how fix that?
     
  25. Debashishb06

    Debashishb06

    Joined:
    Feb 7, 2013
    Posts:
    8
    just replace this script in your project is working fine its only disable CharacterController on pre-teleport and enable the post-teleport on DoTeleport method line no.761
     

    Attached Files:

    sbanbury and alsantour like this.
  26. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    243
    I went for the "simple" teleportation (no thumbstick to change teleportation orientation). What worked for me on Oculus Quest:
    -̶ ̶t̶h̶e̶ ̶f̶i̶x̶e̶d̶ ̶l̶o̶c̶o̶m̶o̶t̶i̶o̶n̶s̶c̶r̶i̶p̶t̶ ̶a̶s̶ ̶p̶o̶s̶t̶e̶d̶ ̶h̶e̶r̶e̶ ̶a̶b̶o̶v̶e̶ ̶
    -̶ ̶t̶h̶e̶ ̶3̶6̶0̶ ̶o̶r̶i̶e̶n̶t̶a̶t̶i̶o̶n̶ ̶c̶o̶m̶p̶o̶n̶e̶n̶t̶ ̶(̶i̶n̶s̶t̶e̶a̶d̶ ̶o̶f̶ ̶H̶M̶D̶ ̶o̶r̶ ̶t̶h̶u̶m̶b̶s̶t̶i̶c̶k̶ ̶o̶r̶i̶e̶n̶t̶a̶t̶i̶o̶n̶,̶ ̶b̶e̶c̶a̶u̶s̶e̶ ̶w̶i̶t̶h̶ ̶t̶h̶e̶s̶e̶ ̶I̶ ̶s̶t̶i̶l̶l̶ ̶e̶n̶c̶o̶u̶t̶e̶r̶e̶d̶ ̶r̶o̶t̶a̶t̶i̶o̶n̶ ̶p̶r̶o̶b̶l̶e̶m̶s̶ ̶s̶o̶m̶e̶t̶i̶m̶e̶s̶)̶

    still gives problems when rotating with thumbstick inbetween. Why can't Oculus just fix this core issue! This is kind of what their whole business is about.. :D

    EDIT: version 1.41 is out! Let's see if this brings fixes or bugs :D
    EDIT2, tried 1.41, In the Oculus locomotion example scene, I get teleported so far away I only see my skybox and floating point errors make my hands look like spikes. Great job.
     
    Last edited: Oct 9, 2019
  27. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    243
    I got teleportation to work with the script changes, ad by switching off all checkmarks in the inspector that allow for movement/rotation. Then rotation works 100% correct.
    But I would like to combine it with movement with both thumbsticks. And then teleportation still gets screwed up.
    This is on the Quest.
    I regret using the Oculus SDK.
     
  28. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    243
    Out of frustration, I spent yesterday writing my own teleportation and locomotion script that integrates with the Oculus SDK, and it works. Of course not with all the options that the Oculus's SDK has, just instant teleport (trigger).
    I can't understand why a billion dollar company can't fix their own SDKs...
    I have to ask my client if I can share the code though.

    I kept most of the Oculus rig, but taken away some scripts at the root so that only CharacterController is left.
    CharacterController is what I manipulate for locomotion, through CharacterController.Move, and instead of Input.Axis("Horizontal") etc, you use OVRInput.Get(OVRInput.Axis2D.PrimaryThumbstick).y and .x.
    Unity's examplescript is in world space, so you need to multiply the direction vector with a Vector3.TransformDirection, with the Oculus Center camera as a source (then you walk in the direction you're looking at).

    Teleportation is quite simple just a raycast and you move the root of the rig to that location instantly (simple and best against motionsickness anyway). As you don't want to allow people to teleport against a straightwall, you can add:
    if (Vector3.Angle(Vector3.up, hitNormal) < maxSlopeAngle)
    hitNormal is the hit from the raycast: hit.normal.
     

    Attached Files:

    fredrikvr2019 likes this.
  29. ANS_TT_VR

    ANS_TT_VR

    Joined:
    Nov 3, 2019
    Posts:
    7
    Any news on the share of the code? Lots of people trying to get this teleportation thing to work.
     
  30. Rickmanx72

    Rickmanx72

    Joined:
    Aug 29, 2017
    Posts:
    1
    Thank you!! This annoyance has been driving me nuts and slowing down my development. Now I have perfect locomotion and teleportation controls for my Quest template. Really appreciate it!!
     
    Debashishb06 and shaqq like this.
  31. alsantour

    alsantour

    Joined:
    Feb 11, 2015
    Posts:
    2
    I have noticed that said problem goes away when disabling the character controller momentarily before teleport and then re enable after the teleport is complete. It is strange that this problem was not present in earlier versions, but it may have to do with with the character collider interacting weirdly with the floor when moved.

    Note that the farther the teleport distance is the bigger the "throwback" jump... Although this fixed this particular issues, im still having a lot of issues with the Oculus framework misbehaving especially with Unity 2019 ...
    Im just goign to stick with Oculus 1.36 Unity 2018.4
     
    starpxy likes this.
  32. LDEV_

    LDEV_

    Joined:
    May 2, 2017
    Posts:
    1
    Thanks!!
     
    Debashishb06 likes this.
  33. npatch

    npatch

    Joined:
    Jun 26, 2015
    Posts:
    247
    Solved this in 2019.2.12 just by enabling Auto Sync Transform under Project Settings->Physics. No changes in samples whatsoever. Basically you can't set transform.position properly when a character controller is present anymore without that setting.
     
  34. samra2494

    samra2494

    Joined:
    Nov 23, 2015
    Posts:
    21
    Thank u so much.. you save my day, your solution works in my case
     
    Debashishb06 likes this.
  35. Guitool

    Guitool

    Joined:
    Sep 29, 2016
    Posts:
    4
    I can confirm that disabling CharacterController fixed the problem. I've switched to the simple small asset VRTeleporter that work flawlessly by disabling CharacterController for a few frames when doing teleport.

    Thank you for the trick. The fix posted by Debashishb06 also work fine for me with the standard Oculus locomotion helpers.
     
    Last edited: Nov 23, 2019
    Byakuran17 likes this.
  36. carlagares

    carlagares

    Joined:
    May 19, 2018
    Posts:
    1

    Hello, this post helps me to resolve my problem. I implemented a variant of teleport using door portals, I have expended 3 to 4 days looking the cause of me falling into gravity down. This setting solved my issue after 4 days. :) very much appreciated. It is incredible that one setting made my whole issue all this time.
     
    artfletch likes this.
  37. HorstJockel

    HorstJockel

    Joined:
    Nov 13, 2017
    Posts:
    2
    I tried your solution. If I copy your "LocomotionTeleport" file in the project, i get some compiler errors saying that a few scripts have different values, which are not used anymore... Do you know about that error?
    Do I have to change something in your LocomotionTeleport-Script or should I leave it as it is?
    Thank you!

    Edit: I am using Unity 2019.3.0f3 btw
     
    Last edited: Jan 11, 2020
  38. livj

    livj

    Joined:
    Feb 8, 2019
    Posts:
    10
    I had the same error. I used VRTK4 along with the oculus integration. It works.

    I use Unity 2029.3.0f5
     
    Schneider21 and Jelmer123 like this.
  39. ArdaZeytin

    ArdaZeytin

    Joined:
    Jul 23, 2016
    Posts:
    12
    Is VRTK v4 beta compatible with Oculus Unity Integration to v13.0?

    I am planning to start new project(Quest + Rift S) but still can't decide which packages should i use.
    - Oculus Unity Integration to v13.0 -> Require too many bug fixes and exploring too many hidden problems etc.
    - XR Toolkit preview -> Still have too many missing features
    - VRTK v4 beta + Oculus Unity Integration to v13.0 -> Will it cause maintenance problem in the future due to Oculus updates?
     
  40. Brosi91

    Brosi91

    Joined:
    Oct 23, 2015
    Posts:
    2
    This script gives me complier errors :/
     
  41. Altaireon

    Altaireon

    Joined:
    Oct 23, 2018
    Posts:
    7
    This one fixed it for me. I was using oculus sdk plugin v1.44. Thanks!
     
  42. imjusthere

    imjusthere

    Joined:
    Oct 12, 2012
    Posts:
    72
    This did the trick for me too. I updated the oculus sdk so I could build for the Quest 2 and noticed that they commented out the same line of code I did but it still had the push back effect. This change fixed it. Thank you!
     
  43. invisage

    invisage

    Joined:
    Jun 27, 2019
    Posts:
    23
    For anyone still looking at this:

    Im using 2019.4LTS and the latest release of the Oculus SDK. Disabling the character controller fixes this nicely:

    public void DoTeleport() which is on line 769 in the LocomotionTeleport.cs for me

    var character = LocomotionController.CharacterController;
    character.enabled = false; <-- add this

    At the end of the function:

    characterTransform.position = destPosition;
    characterTransform.rotation = destRotation;
    character.enabled = true; <-- add this
     
    SkizzleD likes this.
  44. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,435
    ended up here again, using 2018.4.30f1 + Oculus plugin 23.1.

    in locomotion scene, teleport is not working (shows red line),
    solution was:
    - create new layer, Walkable (or anything else)
    - set ground to that layer
    - set aim collision layermask for that layer (it was default, so probably teleport ray was hitting player)
    upload_2021-1-11_14-33-38.png
    *Note that screenshot is for navmesh component, assign the layer for the next component instead
     
    Last edited: Jan 24, 2021
    cgiguy and Schneider21 like this.
  45. ibenizer

    ibenizer

    Joined:
    Apr 20, 2018
    Posts:
    11
    Thanks for this - I'm new to unity and XR and tinkering my way around. Could you explain this a bit more for me dummy please? I didn't know where to create the new layer, what type of layer, and on which objects to find that screenshot you are changing that layer? Thank you so much!
     
  46. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,435
    this one shows it https://learn.unity.com/tutorial/working-with-the-layer-editor

    so for example, select the ground floor gameobject, assignt layer to that from the top right layer dropdown.
     
    ibenizer likes this.
  47. ibenizer

    ibenizer

    Joined:
    Apr 20, 2018
    Posts:
    11
    Hi, thank you - I got it working!

    For everyone who had similar problems with understanding this fix:
    I have created a new layer on both GroundSections (01+02) called 'walkable'
    Then, I found the LocomotionController and assigned that layer to everything that is called 'aimCollisionLayerMask'
    (see screenshots)

    Note: Not sure what the green pillars are there for, as the locomotion works independently

    Screen Shot 2021-01-26 at 10.06.31 am.png Screen Shot 2021-01-26 at 10.06.42 am.png Screen Shot 2021-01-26 at 10.06.58 am.png Screen Shot 2021-01-26 at 10.07.09 am.png Screen Shot 2021-01-26 at 10.17.09 am.jpg
     
    VanzKim, fuzzy3d and Proid like this.
  48. mown90

    mown90

    Joined:
    Nov 30, 2018
    Posts:
    9
    From 2022 and from the bottom of my heart, thank you :), "Auto Sync Transform" fixed the issue after adding the code of disabling the controller
     
    npatch likes this.