You should have used the sight system in Invisible Inc. Basically, enemies can't see you if you are hiding behind a wall, unless they are the other side of that wall. It's hard to explain. I believe there are articles about that game mechanic.