2D Grid Movement (turn based)

I trying to create a Turn Based Strategy behaviour where you move a gameObject from 1 tile of a grid to another tile near it

I have created the Grid using sprites as gameObjects but can’t sort out the movement part, I can move tile to tile continuously with mouseClick or w,a,s,d but want to implement the “player can move only x tiles a turn” thing, found in many TBS games

My current setup is like this

alt text

To anyone in same situation as me, here is how I solved both my problems.

  1. Added Colliders to my charGO and tileGO around it.
  2. Created triggerCollider on player to get the tileGO player is standing on, added some conditional statements.
  3. Using the above tileGO, used Physics2D.OverlapCircleAll (±1 x/y tileGO) to get the Colliders from each direction of tileGO
  4. Using each Collider, got the GO of the tiles from all direction. Changed their sprite to a different colored sprite to “visualize” walkable path
  5. Used coroutine, lerp and basic method to detect mouse click on a tile and move player from tileGO to clickedTileGO

Again, this was for a prototype to test out if I can do what I have in mind, once all is done, I will start cleaning the code and workarounds I used, create proper sprites, animations, etc. but this should give you some insight on how you can do it

a*pathfinding can solve that. i cant program it, but there are lots of tutorials online, its easyer on 2d i think.