how to tell what platform you're on.

If there are four connecting squares and the player is on top of them all but mostly over one how can I tell which square it is that the player is mostly on.

I was thinking of setting multiple rays under the player and setting which square had hit the most amount of rays and counting that but I was wondering if there was a more efficient way.

Thanks!

Is it not just the case of comparing the distance from the centre of the player to the centre of each square? The square that is closest is the one you are “mostly” on.