SebLague / Portals

Portals in Unity
https://www.youtube.com/watch?v=cWpFZbjtSQg
MIT License
780 stars 170 forks source link

Portals Not Working In VR #9

Open XtremeThomas opened 3 years ago

XtremeThomas commented 3 years ago

So I have tried using the portals with android for the Oculus Quest as I'm trying to get these portals to work in VR. The portals seem to work fine in the editor but after building to android and placing the build on the Oculus Quest whenever I try to enter a portal, I am teleported to a random location and left to fall through the map. All the scripts are the same as the default ones except for a render script that I changed to work on android but this should not affect teleportation as all I changed was the following,

portalCam.Render();

to

RenderTexture buffer = RenderTexture.GetTemporary(Screen.width, Screen.height, 24); portalCam.targetTexture = buffer; portalCam.Render(); Graphics.Blit(buffer, viewTexture); RenderTexture.ReleaseTemporary(buffer);

I have been trying to fix this for a couple of weeks if anyone has any ideas help would be much appreciated.

jandfranc commented 3 years ago

I am also working on portals in VR, and am running into an issue where the graphics are 'distorted' from where they should be, was wondering if you also hit this issue when using portals and if so how did you solve this? Also, I reckon the issue you are facing with the teleportation could be to do with the character controller on OVRPlayerController if you are using that. To do teleportation I found I needed to disable it before teleportation and reenable it afterwards so it didnt 'slingshot' the player

cordlessblues commented 1 year ago

I am also attempting to make these in VR chat useing udon sharp and my plan is to not have the mesh not pass through the portal but to just teleport so ima gut the portal code and do a bit a work around as you can't get the camera from the players avatar so no camera plane trickery witch sucks but I can attach a game object to the head and use it's transforms I could also make a camera that has the same settings to reference but I may have to change the code a lot good thing I have the whole summer