Portal travel (Jonas B)
Portal travel itself is quite easy to implement. One just needs two objects that are considered the portals. If the players hitbox then hits the collider of one of the objects, it gets teleported to the position of the other object.
After implementing this rudimentary concept, I looked into making this system much more expanded. For example it should show the view on the other side of the portal. Or should interact with more than just the player (throwing an object through it.)
Some of the sources I consulted:
- Toms dev blog
- PortalsVR (unity 2019)
- Another vr portal repo
- Another one :)
- Brackeys video on portals
- Jaanus' source
Demo video
Update 10/03/22
I've dropped the idea of trying to make a camera show the other side of the portal. Oculus Quest 2 is simply not ready for this yet. A lot of issues arose with the 2 eye cameras that each had to render a picture of what was on the other side. I did not manage to create one complete picture of the two merged. This basically always lead to feeling cross eyed and made me feel nauseous.
I've settled for a simpler approach based on the initial implementation. With some cool effects that add to the vibe of a wizards portal and the optionality to create portals with different colors, rotations, ...
I spent close to 20 hours trying to figure the camera thing out. So a lot of time was "wasted" here. However, I decided to implement a Dashing system to the game so that I can at least make up for the lack of complexity of the portals.