Loading...
We need to add an environment and create an XR Experience. This will automaticly add a button to our scene to go into VR mode.
We can also add the WebXR directly to a loaded model without an environment.
const env = scene.createDefaultEnvironment(); const xr = await scene.createDefaultXRExperienceAsync({ floorMeshes: [env.ground] });
// Async call BABYLON.SceneLoader.Append("https://www.babylonjs.com/Scenes/Mansion/", "Mansion.babylon", scene, async function () { var xr = await scene.createDefaultXRExperienceAsync({floorMeshes: [scene.getMeshByName("Allée")]}); });