2

My current stack:

  • Headset: Oculus Quest
  • Unity: v2019.2.19f1
  • Oculus Integration: v12
  • OS: MacOs Catilina

I have followed a basic tutorial about teleporting and it was working well: I was able to use the left thumbstick to define the new target & orientation of the avatar teleportation. However, after updating the Oculus Integration for Unity to the latest version (v12), it stopped working.

This is the structure of my LocalPlayerController prefab:

enter image description here

and this was the previous (working) configuration of the LocomotionController object:

enter image description here

after the update, I noticed that 2 scripts changed: LocomotionController.cs and TeleportInputHandlerAvatarTouch.cs:

enter image description here

LocomotionController.cs

if we analyse this script more in detail we can notice that two fields (CharacterController and PlayerController) have changed type.

/************************************************************************************

See SampleFramework license.txt for license terms.  Unless required by applicable law 
or agreed to in writing, the sample code is provided “AS IS” WITHOUT WARRANTIES OR 
CONDITIONS OF ANY KIND, either express or implied.  See the license for specific 
language governing permissions and limitations under the license.

************************************************************************************/

using System;
using UnityEngine;
using System.Collections;
using JetBrains.Annotations;
using UnityEngine.Assertions;
#if UNITY_EDITOR
using UnityEngine.SceneManagement;
#endif

/// <summary>
/// Simply aggregates accessors.
/// </summary>
public class LocomotionController : MonoBehaviour
{
    public OVRCameraRig CameraRig;
    //public CharacterController CharacterController;
    public CapsuleCollider CharacterController;
    //public OVRPlayerController PlayerController;
    public SimpleCapsuleWithStickMovement PlayerController;

    void Start()
    {
        /*
        if (CharacterController == null)
        {
            CharacterController = GetComponentInParent<CharacterController>();
        }
        Assert.IsNotNull(CharacterController);
        */
        //if (PlayerController == null)
        //{
            //PlayerController = GetComponentInParent<OVRPlayerController>();
        //}
        //Assert.IsNotNull(PlayerController);
        if(CameraRig == null)
        {
            CameraRig = FindObjectOfType<OVRCameraRig>();
        }
        Assert.IsNotNull(CameraRig);
#if UNITY_EDITOR
        OVRPlugin.SendEvent("locomotion_controller", (SceneManager.GetActiveScene().name == "Locomotion").ToString(), "sample_framework");
#endif
    }
}

I was used to set those fields simply by dragging the LocalPlayerController prefab into the unity editor fields, but now it's not possible. Not sure where should I pick that CapsuleCollider and SimpleCapsuleWithStickMovement. If I touch the left thumbstick my player moves around, which is not the intended behaviour and I don't know how to change it.

TeleportInputHandlerAvatarTouch.cs

This script just add two new fields were added (I guess for the new hand tracking system) but I don't think it's creating problems with the current configuration.

I'm completely stuck and not sure how to proceed from here. No other scripts seem to have been updated with the last upgrade and all my researches were unsuccessful.

Claus
  • 5,662
  • 10
  • 77
  • 118

3 Answers3

1

Research lead me to this reddit post lamenting the same issue, but in their case they seem to have simply added two components to the PlayerController: a CapsuleCollider and SimpleCapsuleWithStickMovement. Both should show up in your current project if you search for components to add to PlayerController. Then you apparently can simply disable those components and your game should be playable without throwing errors, though whether the behavior is what you want is another question.

Klaycon
  • 10,599
  • 18
  • 35
  • I have tried to add the two components to `LocalPlayerController`, reference them in the `LocomotionController` script, then disabling them as you suggested: the teleport ray now appears but it seems not working. For some reason, the left thumbstick makes me move around while the right thumbstick makes me turn quickly, both behaviours which don't seem specified anywhere in the other script. Clearly there is some collision between the scripts. To be honest I'm surprised by the poor quality of the edits in the upgrade. The source code was just disabled without any comments or indications. – Claus Jan 28 '20 at 17:17
  • Yes, the upgrade seems problematic. There are very few resources on this so it seems like you might have to dig into the scripts and figure out what's going wrong manually. – Klaycon Jan 28 '20 at 17:33
  • I agree, by the way any idea why was this question downvoted? If you find it useful an upvote would be appreciated. I don't get how people expect to improve questions without a detailed feedback – Claus Jan 28 '20 at 17:59
  • I'm not sure why it was downvoted. I think it's a finely formed question, plenty of information for prospective answerers, but I doubt you'll get much of value considering oculus quest development seems to be a closed ecosystem. I'd suggest trying other forums or the unity Q&A board too if you haven't already. – Klaycon Jan 28 '20 at 18:01
  • Thanks, I appreciated it. I've already posted on the Unity and Oculus forum, I just wanted to get extra feedback – Claus Jan 28 '20 at 18:03
1

After almost three days and an infinite amount of experiments, I have found a configuration that makes teleport working with the Oculus Unity integration v12 for Oculus Quest.

1. Setup for PlayerController

This is the Player Controller object structure:

enter image description here

you need to disable CharacterController and OVRPlayerController

enter image description here

this will re-activate the teleport laser but it won't likely work with all the surfaces. In order to fix this problem, we need an extra step...

2. Setup for LocomotionController

Looks like a bug was introduced and it prevents a correct collision detection when Aim Collision Type is set to Point. In order to make it work we nee to set it to Sphere and give any relatively small Radius/Height (in this case 0.1)

enter image description here

...this did the trick for me.

Hope this will help!

Claus
  • 5,662
  • 10
  • 77
  • 118
0

I think the correct answer for now (31.01.2022) is that you need to set in Locomotion Controller -- Teleport Target Handler Physical -- Aim Collision Layer Mask to Everything (or what makes sense for you). By default it's Nothing, so in human language it was "there is no surface which I allow to aim to telepor there" and we set it to "Everything".

enter image description here

Dmitrii Dushkin
  • 3,070
  • 4
  • 26
  • 37