[Beginner] How do I convert mouse position to a cells x & y coordinate? eg: So I can do a SET_CELL?
So I'm playing with the demo project supplied "Grid-based pathfinding with Astar" (navigation_astar).
And if you mouse click or SHIFT click, a start or end tile is place where you click. So you might click at mouse position 1000,500, but this is translated into a SET_CELL(18,9,1) for example.
I'm trying to alter the script so if I right click on a tile it toggles between tile 0 or -1 simply to make a "wall" appear and disappear at that position. But for the life of me I cannot workout how to convert the mouse positions to tile/cell positions.
Anyone able to tell me the magic required to convert the mouse X & Y values to the cell X & Y values below the mouse?
Following the demo, I can't work it out