Hello everyone,
I’ve had no trouble assigning random textures to clones, but I’m having difficulty doing the same for imported meshes. Here are the goals for my project:
Goal 1: Assign random textures from an array to an imported mesh (or to the instances generated from this mesh).
Goal 2: Based on which texture a mesh receives, create a unique result for that mesh. For example:
if texture 1–mesh.position.x += 1;
or…
if texture 2–mesh.rotation.y += 2;
Here’s an example PG I’ve been using to work on these goals:
https://www.babylonjs-playground.com/#L5EB6B
You’ll notice that each the clone parents are assigned 1 of the 3 random textures. The imported mesh (and its instances) receive a random texture also, but it’s the same for all of them.
You’ll also notice my failed attempt at Goal 2 commented out
Any help or suggestions would be greatly appreciated!