Happy Patel Posted March 24, 2018 Share Posted March 24, 2018 Hii give error when i add texture image to meshe .see code below remoteMaterial[2].diffuseTexture = new BABYLON.Texture("homepage_hero_image_3.jpg", scene); Error Uncaught TypeError: Cannot set property 'diffuseTexture' of undefined But remoteMaterial[2].diffuseColor = new BABYLON.Color4.FromHexString(hex); this code work fine .i am new in babylon so i have no idea about this error. thank you Quote Link to comment Share on other sites More sharing options...
JohnK Posted March 24, 2018 Share Posted March 24, 2018 Welcome to the forum. Things are always quiet over the weekend. Is your texture file loading? Check network section of console. Quote Link to comment Share on other sites More sharing options...
Happy Patel Posted March 26, 2018 Author Share Posted March 26, 2018 Hi johnk texture file not loading. remoteMaterial[2].diffuseTexture = new BABYLON.Texture("homepage_hero_image_3.jpg", scene); this line give error. I think remoteMaterial[2] Array does't work in diffuseTexture but work fine in diffuseColor . Quote Link to comment Share on other sites More sharing options...
JohnK Posted March 26, 2018 Share Posted March 26, 2018 If your texture file is not loading you cannot apply it as material. Check your path to file. Try your code in the playground using one of the playground available textures http://doc.babylonjs.com/resources/playground_textures GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted March 26, 2018 Share Posted March 26, 2018 Can you try to repro in the playground? 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.