Um.. i think he means off of the edge of the matrix...
There is two ways to do it...
1) you can make four plains, and position them at the edges of your matrix, then check for collisions, or,
2) you can just check the character's position and if it is greater than the position of the edge of the matrix, then, reposition the character back on the matrix.
Eg:
If x# >= 10000 Then x# = 10000
If x# <= 0 Then x# = 0
If z# >= 10000 Then z# = 10000
If z# <= 0 Then z# = 0
Hope I Helped...

Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy