Guys you are way over complicating this. Go to your attributes tab and open the limit information planel. In there you can limit 2 axis to min=0 and max=0, and limit the third axis so your object doesn't go through the wall.