Scene.load in Documentation

in Documentation at Loading, displaying a scene (simple loading of 3D models) | Manual | Castle Game Engine there are 2 example codes.
if i write “Scene.Load(‘car.x3d’);” i get an error “file not found”

if i write “Scene.Load(‘castle-data:/car.x3d’);” then it works.

1 Like

Yes, indeed it’s a typo. @michalis

Overall, Castle Game Engine uses URLs for most operations. I.e. you can still use Scene.Load('car.x3d'); in case car.x3d is in the root directory of the project (will be converted into file:///car.x3d. But usually all the assets should be located inside the data folder as that article recommends, and then they are accessible through internal castle-data:/ protocol which also guarantees that the Engine will find the assets on different platforms if they have to be moved to a different location, e.g. on Android and iOS.

Thank you for the explanation.

I fixed the manual page:

  1. it now shows castle-data:/car.x3d, which will look inside data subdirectory as @eugeneloza explained. (More info on Data directory | Manual | Castle Game Engine . )

  2. aaand then I did another change, scheduled there since a long time: changed the sample car and road to be in glTF, not X3D formats. glTF format can be easily exported from Blender ( Exporting from Blender | Creating Game Data | Castle Game Engine ) and we advise it now.

So it’s actually castle-data:/car.gltf now, in both manual pages

I work on these 2 manual chapters intensively now anyway – I want to update them to document how to do it all visually using CGE editor.