Hi everyone,
I’m new to Babylon.js and could really use some help with an AR project I’m working on.
I’m trying to build an AR portal spawner, based on this Babylon.js Visual Effects Portal demo.
Instead of placing the portal using the hit ring on the floor, I want my app to:
- Continuously perform AR HitTests to find vertical wall surfaces
- Store valid wall hit points
- Run a loop that:
- Waits 3 seconds
- Picks a random valid wall hit point
- Spawns a portal flush with the wall (floor to ceiling height)
- Shows a scene behind the portal (goal: allow scene objects to enter the room through it)
- Waits 10 seconds
- Removes the portal with a vertical wipe animation (this part works)
- Repeats
Current Issues:
- The portal is spawning perpendicular to the wall instead of flush with it
- The occlusion mask doesn’t work
- The scene behind the portal doesn’t appear at all
I’m testing on the Meta Quest 3 using WebXR. Any help or suggestions would be greatly appreciated!
My Code:
Reference Example:
Thanks in advance!