You can constrain an individual axis with the Position constraint. For example you can have an object only constrained on its Y-axis.
- Create a Position constraint. See Constraining an object’s translation with another’s translation for more information.
- Double-click the Position constraint in the Scene browser to select it.
- Open the Properties window. The constraints settings display.
- Expand Constraint Axes and disable the X, Y, or Z axis for the desired translation effect you want to inhibit.
- To reactivate the unconstrained axes, activate the option.