Locking linear motion using constraints

I’ve had a question posed to me that I’ve tried to solve in the past. Take a flywheel, add a connecting rod, piston and cylinder. Spin the flywheel and make it all move. I’ve gotten all of this working using Child-Parents and Track-To constraints, except, the piston still wants to rotate about the center point. All I need is a way to make it "slide when it’s pulled.

I’ve tried the “Lock Track” option thinking that I could lock it along an axis, but it doesn’t work. If we could get this working, we’d have a nice simulation creator.

Any ideas?

Hmmm, I’m sure that I’ve got a blend file somewhere at home that does exactly what you’re after. Of course, I’m at work now, and can’t remember exactly what I did… If no-one else replies, I’ll post here later!


Thanks- any help will be appreciated!

Here is a simple sample blend file I made:


Press alt-a with the cursor in the 3D window to run the animation.

Tip: When creating something mechanical like this make sure that you (ctrl-a) apply size and rotation to all your objects and clear all rotations (alt-r) from all your empties BEFORE starting to parent and apply constraints. This makes the local and global axis the same for all your objects and empties which helps to avoid many problems.

Good Luck,

Thanks for the tip. Since my work computer blocks your site, I’ll need to wait till I get home to check out your model. Thanks again!

Thanks for the sample model. I’ve been able to get this far. The problem I’m having is trying to get a piston to slide in a stationery cylinder. Basically going from the rotary motion to a straight sliding motion, like in a standard engine. I’m actually modeling an engine like your sample model, but would like to find a linear locking method. Basically not allowing rotation, only movement along one axis.

Thanks again.

I’ve PM-ed you, but thought this might be what you’re after:


The piston-rod is a bit screwy (sorry) but I think that the linear-motion is what you’re after…

… Of course I’ll have to pull it if it gets too many hits due to my bandwidth limitations… %|


Another example of how to do it:


Click on the link “Piston Example” to download (let me know if it doesn’t work)

You should be able to see what I did, except maybe that Empty.001 is a vertex parented to the end vertex of the piston rod.

Let me know if you need clarification.

Now that I understand what you were talking about here is a piston being driven by a wheel



Thanks for the examples! Now it is becoming clearer. I never thought to use the copy location constraints. Thanks for the help!

I really have a problem with your example.

-> I do understand why one can’t use simply a TrackTo Constraint for the rod.


  1. Is it possible to solve the problem only with bones, without the second rotating circle?
  2. If it’s not, is there a fixed mathematical relation between the diameters of the circles and their rotations?

I simply don’t get them to match exactly, I always get a gap between rod and cylinder in certain moments during the rotation.