Download

Math issue with hex grid implementation

Greetings everyone,

I’ve been trying to implement a hex grid and it’s been rather poorly. I’ve followed the steps for the math laid out by Red Blob (Hexagonal Grids) but whenever I try to replicate it this is my final result:

The chunk of the blueprint that deals with converting from Rows/Columns to XY is the following:

And the one that works backwards is the following:

Explaining: Q and R are columns and rows in Cube coordinates, so I have to convert back and forth from cube to offset which is the one I used to build the grid. My grid was a variation of Reid’s Channel Optimized Grid Tutorial (Unreal Engine 4 - Optimized Grid Tutorial (1/4) - YouTube)

I’ll appreciate any help on this matter

this might help? Hex Blocks Game BP vs CPP in Code Plugins - UE Marketplace