Search Unity

Scene trigger with Quest

Discussion in 'VR' started by fluido, Jul 23, 2019.

  1. fluido

    fluido

    Joined:
    Apr 4, 2016
    Posts:
    3
    Hi all,
    I'm trying to make a "teleport" from room A (Scene 0) to room B (scene 1) using Quest. I add a rigidbody to the OVRPlayerController and an active trigger (collider) on one cube. If I move with the controller it works perfectly switching form one scene to another, If I move phisically in the space the trigger doesn't work.

    the code is very simple
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.SceneManagement;

    public class SceneTrigger : MonoBehaviour
    {
    void OnTriggerEnter(Collider other)
    {
    SceneManager.LoadScene(1);
    }
    }

    Unity version 2019.1.8f1
     
  2. Fdo_decea

    Fdo_decea

    Joined:
    Jul 29, 2017
    Posts:
    12
    Looks like if you move physically you are leaving the object thats has the rigidbody at some place behind. Check how your the hierarchy setup for your OVRPlayerController...
    On the other hand I can say that with characterController it works perfectly, as I 've already tried it, both two movement types, controller and physical movement, and the triggerenter event is called properly ;)
     
  3. fluido

    fluido

    Joined:
    Apr 4, 2016
    Posts:
    3
    SOLVED
    The problem was the object on which the rigidbody and the collider are connected. I add the components into the CenterEyeAnchor and it works perfectly
     
  4. Chapmania_Design

    Chapmania_Design

    Joined:
    Jan 27, 2017
    Posts:
    8
    Hi. I realise this is an older thread!

    Do you mean that you put the rigidbody and mesh collider on the CenterEyeAnchor?

    Could you put it on the Oculus controller instead (within tracking alias - child of OVRCamera)?