GLTFUtility
GLTFUtility copied to clipboard
How to Load .glb files on a WebGL build, from StreamAssets folder.
Currently I have my project running in webGL.
I get the filepath to my glb files from my StreamingAssets folder in my WebGL project public static string currentModelFileName = Path.Combine(Application.streamingAssetsPath, "");
then I attempt to load in the glb files. Importer.LoadFromFileAsync(currentModelFileName,new ImportSettings(),onLoaded);
However i get the following error:
DirectoryNotFoundException: Could not find a part of the path ‘/file:/...../StreamingAssets’
Any suggestions on what to do or how to fix would be very much appreciated!
Hello @ucabcnd ,
You should have a look at this :
- https://docs.unity3d.com/Manual/StreamingAssets.html
- https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.Get.html
To read streaming Assets on platforms like Android and WebGL, where you cannot access streaming Asset files directly, use UnityWebRequest. For an example, see Application.streamingAssetsPath.
Regards.