Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
justing's avatar
justing
Explorer
5 years ago

Problems with Locomotion Sample

I am posting these problems and resolutions for the Locomotion Sample here in the hopes it will save someone else time.  This is with the Oculus XR Plugin version 1.6.1 and Unity 2020.2.0f1 using a clean URP project, although different combinations may apply.

The main problem that took me a while was that teleportation, besides node, was not working with the sample scene. Debugging the code, I found that the layer mask was wrong for collision detection. This is easy to fix, once you know it, under the LocomotionController, for the target handles, ensure the layer mask is set to just Default. It showed as mixed for me on the Nav Mesh and Physical ones. I am not sure if it is corrupted in the package or somehow just in my environment configuration.

A few other things that may be helpful to others working with this project:
  • The documentation says teleportation (not nodes) is using Nav Mesh. The current implementation at least as of this version (1.6.1) is default to using the Physics colliders, not the navmesh. This is actually more useful, as player movement is usually based on the Physics engine and Nav Mesh is for AI characters. If you want to try Nav Mesh, get into the LocomotionSampleSupport.cs and change the target handler type in the appropriate setup method.
  • For URP, you will want to upgrade the materials, as usual, however, there are some custom shaders you have to manually replace. In this sample, the node teleportation locations will be invisible if you are using URP. Go to TeleportPoint in the scene and edit the Column Glow material then replace the shader. I used a standard URP > Lit shader with a green color and transparency to make this quickly.

8 Replies

Replies have been turned off for this discussion
  • Hello,
    I'm having the same problem but don't understand your solution. For the Locomotion scene I'm seeing, the LocomotionController object (under PlayerController) has Layer as Default, but that doesn't sound like what you're saying. Not sure what the target handles are.
    Thanks!
  • Found it and the fix worked for me. The LocomotionController has a Teleport Target Handler Nav Mesh and a Teleport Target Handler Physical. For both of these set the Aim Collision Layer Mask to Default. Thanks again!
  • There's another big problem with this same sample: the display goes black at unpredictable times. It depends where I'm looking: I can look in a direction and it goes black, then look away and I see the surroundings, and I can go back and forth. Changing the XR Plugin version didn't help.


  • There's another big problem with this same sample: the display goes black at unpredictable times. It depends where I'm looking: I can look in a direction and it goes black, then look away and I see the surroundings, and I can go back and forth. Changing the XR Plugin version didn't help.


    I fixed this one too. PlayerController has  Character Camera Constraint script. I commented out lines 96 and 106 that use the OVRScreenFade.instance.SetExplicitFade() function. This might have side effects and the real solution is to get the program to not think there is overlap/clipping when there isn't, but I'm happy for now.
  • Thank you for posting this and the solution, Justing and Scepticalchymis are true heroes 🙂 

  • edusuko's avatar
    edusuko
    Honored Guest

    The solution is to add a script component OVRScreenFade to the gameObject where is the CharacterCameraConstraint component.