Hi,
I’m trying to set the material of a skybox to a SkyMaterial.
I’m importing the latest babylon.js and materials libraries in my HTML.
My code:
const skyboxMaterial = new BABYLON.SkyMaterial(‘skyMaterial’, scene);
skyboxMaterial.backFaceCulling = false;
const skybox = BABYLON.MeshBuilder.CreateSphere(‘skyBox’, { diameter: 1000, sideOrientation: 2 }, scene);
skybox.material = skyboxMaterial;
This works in the playground and also in the TypeScript project I took it from.
The error I get is as follows:
Uncaught TypeError: babylonjs_Misc_decorators__WEBPACK_IMPORTED_MODULE_1__.Quaternion.FromUnitVectorsToRef is not a function at SkyMaterial…/sky/skyMaterial.ts.SkyMaterial.bindForSubMesh (babylonjs.materials.js:5671)
Not sure why this happens. I made sure to get all the latest babylon files and import them. Anyone know what I’m doing wrong?