Raycast detour advanced flee

How can i make a character flee with raycast detour and pathfollow to?:confused:

Hypothesis: use the near sensor and the state machine to change character’s behavior? If player is near–> flee. If not–> goal.

the distance property determines the relax distance. check out the attached file.
work with 2.60rc1


flee_test.blend (422 KB)

What i really wanted was the character to stay on the navigation mesh
while fleeing.Looks like to me you have to use nodes with raycast detour to duck behind objects come out and attack and over again and the state engine and you can randomise it with game logic.