I'm currently making a platform game with a main chahracter and a fairy that follows him, and you may switch between them. The game has 3 types of character control: Control only character (platform), control only fairy(8-direction) and control character while fairy follows him, like Navi and Link.
The point is: as i want, to switch to follow mode, the distance between player and fairy must be lower than a distance i defined, but if they are separated by walls, the fairy just go through it. This is because in the follow mode the fairy is just a sprite, while in control mode is a 8-direction.
I wanted to make the game switch to follow mode only if the PATH LENGHT were lower than a minimun, rather than the direct distance.
Sorry for any grammar error, i'm not american.