So I have a curve and an object moving along the curve using the curve modifier. My question is can I lock an axis so the object will, for example, only move back and forth on the x axis, or y axis, or the z axis?
Okay so with some help from Mr Zak, I found the solution to this problem.
So for anyone wondering, I was needing this for a 3D printing type animation. Anyway, start with your curve and some objects.
Add the "Follow Path" constraint and in select your curve for the target. To animate, go to your first frame and keyframe the "Offset:" to -100 (this may be different for some curves but this works for most). Then go to the last frame and keyframe the "Offset:" to 0 (if these values don't work, just drag the offset value until it looks right).
The cubish object in the picture just follows around the curve (for you 3D printers, it's the extruder).
The two cylinders just move forward and back with the cube (this just achieves the look of the cube moving left and right and the bars moving forward and back).
For the object you want moving only on one axis, do the same as before but add a "Limit Location" constraint after the "Follow Path" constraint.
If you want it on one axis, check the "Minimum" and "Maximum" boxes for the desired axis. If you follow the instructions up to this point, then it won't change it's position on that axis while it moves. Here's a gif showing what mine looks like