Hello everyone! Thanks for taking the time out to read my question. I am looking for opinions and advice on the best way to calculate what tiles an object is allowed to move to. To best describe what I am looking to do, and what i have done, ill throw some illustration below.

A = allowed

X = not allowed

O = object

XXAXX

XAAAX

AAOAA

XAAAX

XXAXX

I am currently using Raycast.Overlap Sphere to cast a sphere with a length equal to how many movement points the character has but am not able to get the desired result. The result I am getting is below

XAAAX

AAAAA

AAAAA

AAAAA

XAAAX

it is picking up the diagonals which i dont want.

Basically what i am looking to do is calculate tiles the player is allowed to move to and the player is NOT allowed to move diagonally. Is there a better way the raycast sphere, or just raycasting in general, to calculate this? Thanks for all advice!