Carharttguy Posted August 3, 2017 Share Posted August 3, 2017 Hello I tried to import a file with the assetloader. This works, the file is loaded but gets another name than expected. Is the name an internal obj file name or something? And second, after loading the asset, I cannot access it via scene.getMeshByName. See playground here: https://www.babylonjs-playground.com/#ZJYNY#25 As you can see, the name of the skull.babylon file is "test" as returned via the alert. But then accessing the file via scene.getMeshByName("test") returns null. Where is my logic flawed? Thanks for insights! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 3, 2017 Share Posted August 3, 2017 hello this is because the loading is asynchronous. You have to use the callback to get called when data is ready (the onSuccess or onFinish are fine): https://www.babylonjs-playground.com/#ZJYNY#26 Quote Link to comment Share on other sites More sharing options...
Carharttguy Posted August 3, 2017 Author Share Posted August 3, 2017 Thanks Deltakosh, this works fine! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.