Modular Showroom, Random Mesh, random Material or Random Texture?

Hi everyone!
I’m Working on a modular showroom as you can see here:



As you can It works! (Thanks to the udemy courses). It consist of A start and a end object, and in the middle several instance of the same objetc. The problem is the texture repeat.
I thought 3 solutions
1 randomly offset the texture. as it’s a tilable texture it shouldn’t be a problem
2 create several material with different textures and randomly apply them
3 create several middle modular block and asign them randomly

I think the first solution is the easiest but I didn’t manage to do it. And for the two other, I really love to know how to do that.

I tried to use a per Instance Radom to offset the texture, but it seems that the duplicate part in the blueprint are considered as the same instance

One question first: Do you tick the checkbox called “Used with instanced static meshes” on the left panel in the material properties?
As I recall, perInstanceRandom needs it ticked. Might be the reason, why the tiling doesn’t work correctly.

Thank tou DarkGodsLair. I didn’t know this option. I checked the box, but it didn’t change, the repeat is still there. Maybe, the add mesh create with blueprint isn’t considered as an instance?

I had a look over your blueprint today, because I was too tired yesterday. What you actually only use are static meshes and not instances.
If you want to have instances, I modified your blueprint graph with two nodes, “Add Hierarchical StaticMesh Component” and “Add Instance”:

If you still want to use static meshes and no instances with alternating materials, you can use this:

Hopefully that helps you :).

Good Evening!
Thank you so much DarkGodsLair, you made my day!!! :slight_smile: That’s a lot. Thanks for taking time to make those explanations! Hope it will hep other users too!
Here’s the first test

And the new version of the BP

I don’t know if it’s normal, but nom I have a lot of lag. Does this require à lot of performance?

By the way thak you again, I even managed to make random meshes with the same method:

Glad to be of help.

And yes, spawning lots of static meshes uses a good amount of performance. That’s why instances are a way to generate a lot of objects without the downside of tearing your performance down. Instances are however more difficult to set up, because they have limited options to modify an instance. The downside of instances are that you can’t use different materials on individual instances. Because instances are basicly just a copy of the main mesh it was copied from, they share the same material and the same properties.

Multiple colliders can also mean a slow down of your performance. If you continue to use static meshes, try to make them less complex and more efficient. Make lesser sessions and generally optimize your blueprint. You are also running it in the construction script with two for loops, which are executed on a frame by frame timing. So it is pretty normal that you get lags. If you don’t want the sections to be generated every time you move your blueprint, you can create a bool and set a branch right after your “Construction Script” node. Call it “Generate meshes?” or whatever you want. Then expose the bool to the editor (click on the closed eye icon on the left side of your bool variable). Set the initial bool value to false and plug your newly created bool variable into your “branch” red condition pin.

In the details panel of your blueprint in the world outliner will appear a bool called “Generate meshes?” or whatever you called the bool. If you then tick the box of the bool, it will then first generate your meshes. And if you want to move it again just untick the bool.

Have fun with your project! :).

OK! Understand! Thank You for being so helpfull!!! :slight_smile: