I can't use mesh material outside BABYLON.SceneLoader.Append()

Hello again,

inside BABYLON.SceneLoader.Append() I create stairMaterial=getMaterialByID(“station.Metal_Steel_Textured_White”); and then I want to use this material in another function outside Append(), the problem is my stair still white and mesh doesn’t work (but if I use it inside Appenf() for another box it works fine)

https://playground.babylonjs.com/#KI8BJH#24

line 99 and 26

any idea

Best regards

Just make sure to call your stair() function inside Append so the material is ready when you create stairs:
https://playground.babylonjs.com/#KI8BJH#25

1 Like

@Deltakosh thanks dude
so when calling createscene function it calls stair() before finished append() function so material is disable, I wish I understand the lesson :smiley:

2 Likes