BABYLON.SceneLoader.LoadAssetContainer is not a function?

Hey, in my code I am trying to import from a .glb file and I am getting Uncaught TypeError: BABYLON.SceneLoader.LoadAssetContainer is not a function. I read the docs and took a look at some examples and I can’t see what I’m doing wrong here. Here is the code for the function I’m using to bring in the assets:

function createPlayer(scene, color, data) {

    console.log('this works numero uno');

	var bik;

    // try {
	BABYLON.SceneLoader.LoadAssetContainer("https://raw.githubusercontent.com/IMACULGY/Protron/master/assets/", "bike.glb", function (assets) {
            //scene.createDefaultCameraOrLight(true, true, true);

            console.log('this works');

            var meshes = assets.meshes;

            var mat = new BABYLON.StandardMaterial("mat", scene);
            	mat.diffuseColor = color;
            	mat.backFaceCulling = false;

            for(var i = 0; i < meshes.length;i++)
            {
                meshes[i].material = mat;
            }

            bik = BABYLON.Mesh.MergeMeshes(meshes);

            bik.scaling = new BABYLON.Vector3(0.5, 0.5, 0.5)
        	bik.layerMask = 2;

        	if (data) {
                	bik.position.y = data.y;
                	bik.position.x = -data.x;
                	bik.position.z = data.z;
                	bik.rotation.y = Math.PI
            	}
        	else {
                	bik.position.y = -1;
                	bik.position.x = 400;
                	bik.position.z = 0;
                	bik.rotation.y = 0
            	}

        	return bik;
        });

Any help would be appreciated, thanks.

You’re missing scene

Should be BABYLON.SceneLoader.LoadAssetContainer("https://raw.githubusercontent.com/IMACULGY/Protron/master/assets/", "bike.glb", scene, ....)

Hey @imaculgy,

First, welcome to the forums! Second, have you tried adding the scene object to the function call?

BABYLON.SceneLoader.LoadAssetContainer("https://raw.githubusercontent.com/IMACULGY/Protron/master/assets/", "bike.glb", scene, function(assets) { 
...

If so, did you get the same error?

Yeah, I have tried using scene and I get the same error. Probably should have clarified. Thanks

This might be a silly question but is this the full function block for createPlayer? The reason that I’m asking is that the snippet provided is missing a curly brace at the bottom. I tried it out in the Babylon Playground (https://playground.babylonjs.com/) but I wasn’t able to recreate the exact error.

Yeah that’s the whole function, my bad. When I get home I’ll double check though. Thx again