Navigation of range character on terrain with obstacles

Is here any way to use Move To Location or Actor on range character?
I have range character that can attack across low objects, but when the path to target is blocked with law the range character start to search for longer path


There is possible situation where the blue path is shortest, the character could attack across the wall, but the range character will travel the red path until it reaches a point of direct visibility to the target. I saw games like League of legends where the character movement has same issue, but in games like Counter strike the AI could use windows to aim. What is the best way to deal with this problem?