It goes in order of where your character is facing and relation to who is on screen.
So like, if your character is facing right, and you press D-pad right, the first selectable thing is the thing right in front of what your character is facing. After that, it's whatever is to the right of that object.

It's weird.