Generate Hexagons in a hex shape, given a 2d Array

I’ve looked at the website and used the map storage part to create a 2d Array (the ue4 way with structs) that looks identical to

Given this array I want to generate a hexagon grid of hex tiles that contain hex instanced static meshes that look like these

How do I generate this grid for any size array? I’m trying to also align the grid to the center hexagon location. (For the picture example the center is [3,3])
Any help would be appreciated, thanks!

I realize now the formula for this would be…
X Coordinate = ((Row - MaxIndex/2) * WidthSize) + ((Column - MaxIndex/2) * (WidthSize / 2))
Y Coordinate = (MaxIndex/2 - Row) * Height * 0.75)

1 Like