How do I make things on a grid

I want the defenses when placed to be directly on the grid and i want them only adjacent to the fences. Can someone tell me how to do this?
Here’s my game-https://flowlab.io/game/play/1116489

Like plants VS Zombies?

Yea

I have things to do, but once I have an example ready for you to use, I’ll tell you.

You could move things on a grid that is on Flowlabs grid by moving the Position (set to grid).
You can use a filter on the Y to only move on the places that are adjacent to the fence.

Thanks, An example would be easier to understand but i’ll manage