I have a model for a soccer robot which has a "leg" that can be used to shoot a ball. It is capable of shooting from a low and high position, allowing the ball to be shot through the air or plainly across the ground. I have achieved this initial behaviour using a rig with one IK controller and some constraints:
However, now I am slightly confused by the next step. This leg is connected to a plunger as well, which prevents the leg from clattering back and forth. It is connected to the leg via a pair of wheels on the inside of the leg, kind of like a slider, as shown here:
This plunger will thus have to be able to extend and retract as the leg moves. I have tried to achieve this using a bone for the plunger which has a Copy Location constraint for just the Local Y axis (the direction along which the plunger should move). While it slides in and out as desired, there is a little issue: it always seems rather offset from where it should be for some reason:
I can "fix" this by just moving it back with Offset enabled, but this seems like a rather dirty fix + I would like it to be quite accurate. Things that I have tried:
- Apply location and scale of the plunger mesh, other meshes involved and the rig
- Move the origin of the involved meshes and the armature
- Try different constraints, such as Limit Distance. This generally leads to the same results
- Rebuilding the rig from scratch
Screenshot of the constraints on the plunger bone:
Attached is the .blend file with just the relevant objects included. I'm trying to understand why this is happening and/or there is a better alternative method available.