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:


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


1 Like

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