fixed warping when getting close to walls.