1
\$\begingroup\$

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.

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

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 ^^

\$\endgroup\$
1
  • \$\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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .