prevent walking into walls and update UI