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?
asked Jul 30 '16 at 08:56 AM in Blueprint Scripting
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.
answered Jul 30 '16 at 09:08 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here