I have a hex grid and a game object, let's say it's the player. What I want to do is know on which cell the player is on based on his world position, this would be easy on a simple grid but on a hex grid it's giving me a headache.
1 Answer
\$\begingroup\$
\$\endgroup\$
1
Maybe this useful and complete article may help you : https://www.redblobgames.com/grids/hexagons/
There's 4 different possibilities for implementing an hexagrid. Depending on your "offset coordinates". For each type the article explains how you can convert position to hex coordinate.
And good luck, I had to implement such system too before this article ever existed ^^
-
\$\begingroup\$ Thank you, i already checked this article but i think i missed the part where it shows how to convert position to hex coordinates, i'll check it again hopefully i'll find my answer :) \$\endgroup\$ Commented Apr 14, 2018 at 20:22