How to randomly assign individual new materials to items in an array, within an InstancedStaticMesh

Watch this:

For your map generation i would do this:

  • place all tile changing logic inside blueprint actor.
  • expose some kind of tile id (like [x,y] coordinates (hex is just grid with every other column shifted by 1/2.
  • when you have actor with that index system, you can create array in place like game mode or game instance that keeps type of tiles terrain
  • now each tile reads that array, and sets its own material according to that.

This way you have game logic separated from how tiles should look.

ps. do not bother with instanced static meshes yet (or never) first make prototype of map, then you know what you really need.

1 Like