Random mesh generator

Greetings, I’m trying to make a simple auto mesh generator for a ThirdPersonCharacter. The idea is to generate on the startup 1 mesh from a few meshes which we place in to the blueprint. Which function is the best to work with and where I can learn more?

Hello, Cryptaline,

If what you want is to pick one mesh out of a list of different possible meshes, and those meshes are already imported as assets (so you are not talking about procedural content here), then it is quite easy.

Just create a variable of the type “Skeletal mesh reference”, name it “Possible meshes list” and turn it into an array. Then add as many entries to that array as you want and point them to your different skeletal mesh assets.

On the construction script, use the get node to get one of the elements of that array. For the index, you can use a “random integer in range” node. The Min value would be 0 and the Max would be your array length. That will pick one random element of your list every time. Then you plug the output of the get to the new mesh input of the set skeletal mesh and you are done.

If on the other hand you are talking about grabbing a bunch of meshes and turning them into a single mesh at runtime, and setting that, then that is another issue and I don’t believe it is possible with skeletal meshes. For static meshes there exist instanced static meshes that you can use.

Yes I was asking about

pick one mesh out of a list of different possible meshes

Thank you alot! Works fine.