I want to have a camera (the player) does not go beyond the stage. So I applied checkcollision on skybox. But it was used outside Cuba behind the scenes and inside the camera falls down from the edge of the stage.
var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(80, 5, -10), scene); camera.setTarget(BABYLON.Vector3.Zero()); camera.ellipsoid = new BABYLON.Vector3(2, 2, 1); camera.checkCollisions = true; camera.applyGravity = true; // Skybox var skybox = BABYLON.Mesh.CreateBox("skyBox", 390.0, scene); var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene); skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("/skybox", scene); skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE; skybox.material = skyboxMaterial; skybox.checkCollisions = true;