Help Needed with 404 Error in Babylon.js Project with Webpack Dev Server

Yes, of course

You’re welcome!


This is wrong:
image

This works:
image

The first parameter is the path and the second one is the filename without slashes.

EDIT: just the filename, so for example yacht.glb

1 Like

When you hover with the mouse over here you can see the available parameters. Isn’t this the case with your IDE?

Hey, thanks that helped! :smiley: The models are now loading, but nothing is displayed, wheter models or textures. Do you may know the issue? I getting no error…


I bet you’re not adding them to the scene. Let me have a look after I finish smoking :roll_eyes:

1 Like

For example, if I write the texture url, it is displayed, so its foundable, or?

Yes you do. But it seems that you are overengineering mesh loading quite a lot. You can use Load, Append, ImportMesh instead of LoadAssetContainer. Read here. Look at the playgrounds. Inspire yourself :face_with_monocle:

The other thing, now there is no sky, no hex world, what happened? Try to fix it :stuck_out_tongue: I have to leave now for a few hours.

1 Like

I made some hacks to make it working, but:

  1. you don’t resize your canvas so it was always 300x150 (or something like that). Adding these two lines will fix it, but not permanently:
    image

  2. you never set this.world.player here so this.scene.render() never get called.

You don’t need the lines 94-96 as well.
Remove all the lines marked by red.

And add this one:
image

Your scene will start to render.

  1. Make the meshes bigger by scaling them and resolve the promise if all is ok.
    image

  2. this function permanently crashes because this._mesh is not set and you try to access it’s properties in this function. So just a hack to make it running, add this:

image

  1. the initial positions z value is at zero and the ground too. The ships zero is somewhere in their middle so they are cut so modify the z values, again just to make them visible:
    image

  2. this observer was crashing because this.player is not set. Again a quick hack to make it show something on the screen:

image

That’s all!

Good luck and happy coding!

2 Likes

Hi Roland,

I have apply you fixes and it works again! Thanks a lot! :smiley: They is just a minor bug left: It loads 4 times the same model instead of differents, also the player is not found(?), therefore they is nore movement :confused:

here a screenshot:

I have pushed my changes to the alpha branch!

:hugs: Sorry, I am on vacation without a PC. I can only suggest you to use the debugger to debug your code.

1 Like

It will be really hard to say without a simple repro in the playground.

1 Like