Originally posted by Luthervian
View Post
First in BP_GridManager_Hex I set GridSizeY to always equal GridSizeY, as this would always be true for a hexagonal shaped grid:

Next, in the CreateGridLocations function, I use GetIndexesInRange (which is overridden to use hex math in BP_GridManager_Hex) to get grid locations in a hexagonal shape. I use some simple math to find the center and radius of the hex grid (note that I'm just replacing the code for a flat grid in the example below, but the same should work for the heightmap setup in the same function):

Next, in SpawnTileGrid I spawn the tile instances using the output of CreateGridLocations:

Finally, I make sure CreateGridLocations is run before SpawnTileGrid in BP_GridManager's Construction Script:

Et voila:

Comment