2D Isometric - How do I make a game object snap to a grid?

Currently making a 2D Isometric tactics like game, I made a selector icon that will be used to select the tile which to send the character to (this will appear after you select the character) , and I managed to get the selector to follow the mouse, but I need help with getting the selector to only move/render when on a walkable tile and snap to the those tiles when I move the mouse around. Anyone know how I would do this?

Additionally I will need the character to snap the grid when they move, but I imagine that will be a little simpler since the character will go to wherever the selector can go. Thanks!

always round the coordinates of the cursor, then set the transform of the selector to those rounded coords

this works best if your world coodinates are 1:1 to the grid

if its not 1:1 if its 2:1 for example then round to every even number etc

I see so basically instead of trying to convert everything else to the coords of the grid, I just convert the mouse cursor coords for purposes of selecting the grid and things on it. This helps a lot, thanks!