How do i randomize my enemy's mesh's

anyone know how

Are you using a single mesh for the whole enemy, or trying to randomize individual heads/bodies/etc.. ?

If using a monolithic mesh, could just set the skelemesh asset using a select node with a random integer:

You can add more pins to get more options, just be sure to increase the max number in the random number generator thigno. Or if the select command box is too unwieldy (or you want different options on various enemies), you could also make an array variable of meshes and get one by index with the random int.

And if enemies are assembled from multiple meshes like head/body/armor/whatevs, just repeat the logic for each component. I did the above on a key press, but the set asset node can also be run in construction script (so you can preview and reroll it in editor viewport) or begin play.

1 Like

i have a enemy spawner and a enemy bluprint but i am trying to make the mesh be random throught the whole mesh no like parts so how do i make a array varible of meshes

Create a new variable, change the type to skeletal mesh, then click the dropdown with the blue minus symbol next to type and change it to array.

Or you could define the mesh and other enemy info in a data table, and select a random row from it in the spawner, then use that row to set the mesh/health/etc.. on the enemy.

1 Like