Playground Works but starterHTML in Browser Fails

This works fine in the playground:

The starter template at:

has been copied to my Visual Studio HTML page.

The only thing I do to the starter template is replace its createScene function with the playground contents above.

It errors out at the scene.meshes[0].createNormals() line with the browser debug mode throwing an exception at it

scene.meshes[0].createNormals();

and reporting that scene.meshes[0] is undefined. The alert(“After meshes”) is never displayed the Browser.

Why is scene.meshes[0] defined in the Playground but undefined in the Browser?

What am I missing here?

Try using the SceneLoader.Append onSuccess callback.

1 Like

Hey, Doc, thanks very much! That was a great idea because it also highlighted the fact I had not included:

in my page! Now it works! Case closed!

1 Like

“”

https://cdn.babylonjs.com/loaders/babylonjs.loaders.min.js is what I did not include.

1 Like