Search Unity

Question AR/VR/XR Portal collision problem

Discussion in 'VR' started by randomechanism, Jan 27, 2022.

?

How can I make this portal run on the oculus quest 2

  1. Change the system

    0 vote(s)
    0.0%
  2. Change the approach

    0 vote(s)
    0.0%
Multiple votes are allowed.
  1. randomechanism

    randomechanism

    Joined:
    Jan 27, 2022
    Posts:
    3
    Hi,

    I have been working on this project where I am trying to create a Mixed Reality Portal. I followed this tutorial to create the Portal:
    go to min: 5:47 to see what it looks like

    Here is the GitHub folder of his project: https://github.com/mrchantey/arportal


    The goal is to have the same thing as in the tutorial but running on the Oculus quest 2.


    How it works:

    The portal is a material on top of a plane(portal window) which can either show the world on the plane itself or everywhere else except for on the plane. As shown in the pictures attached. If the camera is outside of the portal(in the real world) a boolean is set to Equal and if not(in virtual world) its set to NotEqual. This switches as the camera collides with the plane.


    What I managed in VR is to display the Portal itself with the material. What I didn’t manage was to switch into the VR world because the collision between the OVRCameraRig and the plane doesn’t seem to take place and therefore this boolean does not switch accordingly.


    I hope the explanation made sense.

    Does anybody have an idea what I am doing wrong or how I could fix this problem?



    I would be very thankful if there would be an answer to this!
    Kind regards,

    John
     
  2. glenneroo

    glenneroo

    Joined:
    Oct 27, 2016
    Posts:
    231
    So the problem is the collision?
    Did you check under Physics > Layer Collision Matrix, while making sure your camera and portal are on separate layers.
     
  3. randomechanism

    randomechanism

    Joined:
    Jan 27, 2022
    Posts:
    3
    Thanks for the quick reply. Yes, I checked and they are on different layers. The thing that I don't understand is that the portal works on unity in the gameview but not as I export it onto the Oculus Quest.