tpascal : thank you, about your idea
you told me to put my actor in the sphere and check the collision between the map and the sphere if there is any collision that mean there is a block, but the problem that I found if my player walk to the left and then collision with the wall in this case the computer will not see him but the problem if the computer player was standing on the right of my player in this case he must see my player but because the collision (true)he will not see him .


User137 : thank you, but my problem not with the code because it's work very well but I don't know why just in this example I get the value from the "DistanceTo" procedure wrong.
in another example the procedure give me a right distance value between both players but this time it's give me the value + about 215 I don't know why.
like for example it must give me 600 , so I'll put the depth of the cube 600 in this case the Cube will start from player1 and end in player2 , but it's give me 815 for that it start from player1 and end after player2 .
so I want to know is there any code or library make the procedure gives a wrong value?
(the value from "DistanceTo" it must be 600 but it's give me 800)??