Contraints in BGE

Hey everyone. I am still learning about the blender game engine, and wanted to create a small level as a test. I would like it so certain object can only move along the y axis (or up and down) and the x axis (side to side). Kind of like a 2D sidescroller, but with 3D affects.

I have been looking for the past 2 days the answer to my question, and did a search, but they don’t seem to help me. When I add dynamics to an object, and then add a contraint so it cannot move along the z axis, and play the level, the object does get pushed along the z axis, as well as the other ones.

Please tell me if you don’t understand, so I could clear it up.
Acually, here is something I found on Youtube to show you how I would like my style to be:

Thanks guys, and sorry if the answer is somewhere already, but I really tried looking everywhere.

Always — AND — Constraint: Loc X: Min xxx, Max xxx

I hope that helped :slight_smile:

Oh my I am such a noob. lol Thank you so much I was doing contraints all wrong!