Textures from an Array

Hello everyone,

I’m trying to assign a random texture to a mesh from an array. I think I have everything correct except for the line below.

for (var i = 0; i < textureArray.length; i++) {
let material = new BABYLON.Texture(textureArray(Math.random());
};

The PG is here:
https://www.babylonjs-playground.com/#BSX7A4#6

Thanks!

I think what you want to do is something like this:

https://www.babylonjs-playground.com/#BSX7A4#7

1 Like

That’s correct, thanks again @Evgeni_Popov! :smiley: :+1: