Locking to an axis for movement using scripting (so collisions dont pt me of path)

Hey guys, i want to make a side view game where the player can only move baack and forth along one axis, but im not sure how to do with with scripting, i tried using logic but since the character is a rigid body everytime there was a collision with something then it would get knocked of course. So could someone please help me out or help guide me to get something working. ive been stuck for days.

Thanks,
nic

bumpity bump

bumpity bump again, realllllly stuck. Anyone?

you are working with the BGE? seems like you should dig into the Game Engine Forum, take your time to read the stickies.
http://blenderartists.org/forum/forumdisplay.php?12-Game-Engine-Support-and-Discussion