how to rig a hydraulic cylinder?

I have made a robot character in blender that has hydraulic cylinders on its arms and legs. I want to know how to make these hydraulics stretch and compress according to the way the character moves, but I do not know how to make a rig that works this way. I have tried watching a few tutorials on rigging and I have tried downloading .blends of robot arms with hydraulics to see how their rigs are built, but no matter what I do I cant seem to copy the hydraulic rig so does any one here know how to rig a hydraulic cylinder that stretches and compresses according to the way the character moves?

This is not exactly vague, but it covers so much ground that it’s difficult to give you any kind of answer. What does your robot look like? What motions are you talking about when you say “according to the way the character moves”? Is the rest of the robot rigged?

Maybe a screenshot or two, or a blend file would help.

you need to apply a bone to your piston and a target bone that points to your piston then add a stretch to constraint to the piston bone pointing at the target bone


The second part of my piston-rigging tutorial has an example of a hydraulic actuator.

Best wishes,
Matthew

hello!

I think, you need a diferent setup to rigg your cylinder; I mean; an hidrauliyc cylinder consit in two pieces; one cylinder inside other; so; if you rigg only using a bone and strecht that maybe result in a ugly distortion of yhe mesh; may be you need use a bone for each piece; try this:

put a bone in the cylinder of outside (A) and an inverted bone (B) for the cylinder inside; put a track to constraint in the bones, you need what the bone A poit to the bone B and bone B point the bone A…

sorry for my bad english; I can do a fast setup if you need…

you’d think that but surprisingly not. as long as the piston is in two parts just a single bone as set up in my rig works just fine.
however, if you do have stretching issues then simply subdivide the piston bone in two and apply the stretch to constraint on only the rod bone