How to Attach Variables to Objects?

Im working on a tile based boardgame.
The Player moves one tile after another ahead, so only the adjacent ones should be reachable which works in theory fine with physics.overlapbox. But how can i set each tile a boolean variable like “walkable” and access them from another script?
Actually a really simple problem but im a real newbie to c#…
Thanks in advance

Hi @harryer

This is not a Unity or C# question, it is more like about knowing proper approach or method how create movement and collision system for tile / grid based games.

Ditch the idea about colliders and raycasts. You will be better off using data to see what is what in any particular tile. This is how it was done often in old tile based games.

See other threads like this one (or do a search about tile / grid based movement in any language):