I am rigging a robot leg and what I would like to do is to put a lateral bolt that should be fixed to the upper part of the leg and rotate when the knee rotates. What I did was to parent the bolt to the upper leg bone, and then add a copy rotation constraint for the x axis targeting the lower leg bone. I tried all the possible combinations of space (local to local, local to world, pose to local etc) but nothing worked, the bolt rotates not on itself but follows a circle path, moving far away from the leg. How would you achieve the result I'm looking for? Thank you.
So the bolt needs to follow the upper leg, but to rotate when the lower leg rotates.
The copy rotation you used is good. But you need to involve an additional bone to obtain the result :
Here is the setting :
- Add/extrude a new bone from the upper leg
- Set it disconnected
- Place its head at the center of the bolt
- Align it with the lower leg bone and make sure that bolt bone and lower leg bone have the same roll (so that these two bones have the same local directions)
- Assign the bolt vertices to this new/knee bolt's bone group of the mesh
Now (as you did), in pose mode, add a constraint to the knee bone like this :