Glb could not be loaded successfully

I’m a beginner, and am following the tutorial but i am getting an error when loading glb model, anyone help me figure out the reason? Thanks for helping me.

Unable to complete task door: Unable to load from http://localhost/colonial_arch_window_2x1_v2.glb: URL.createObjectURL is not a function: RuntimeError: Unable to load from http://localhost/colonial_arch_window_2x1_v2.glb: URL.createObjectURL is not a function

This is my file: colonial_arch_window_2x1_v2.glb - Google Drive

Hello!

Is this error coming from BabylonJS or from your code? To use the static URL object in the browser you need to have one of these browsers. It seems your browser is not supported.

To load a GLB you can use:

const url = "https://playgrounds.babylonjs.xyz/colonial_arch_window_2x1_v2.glb"
BABYLON.SceneLoader.Append("", url)

or SceneLoader.ImportMesh or their async counterparts. There are other ways to load assets as well. Asset Manager | Babylon.js Documentation

Here is a PG that loads your GLB (you can’t load files directly from OneDrive because of CORS) so I downloaded your file and put it on my server where CORS allows to read the file by another origin.

:vulcan_salute:

3 Likes

Thank you for your reply, I will try it as you suggested

1 Like

I’m using chrome browser and tried to load it from assetsManager but nothing happens. This is my code

Your must call AssetManager.load to load model file.

6 Likes

Sorry for my delay. And thank you for your help