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\$
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\$
  • \$\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\$ – Saad Moutalib Apr 14 '18 at 20:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.