How to rig a ball and socket?

Say I want to rig something like this:

I want the shaft connected to the ball to stop at the rim, no matter where it is

Would this work for rotation that is derived from tracking an empty, such as with eyeballs?


That looks cool, but way more elaborate than what I have time to delve into right now to be honest.
If you could tell me specifically how to rig just a ball-and-socket it would be much more helpful at the moment. :slight_smile:

If you are willing to use bone, you can do the pointing with Inverse Kinematics constraint. When you use the IK constraint, under Bone property, you get a field of rotational limit for each axis.

But remember though, axis listed there are bone local axis.

Thanks ridix!
That makes sense, and yes, I am willing to use a bone.
The only trouble is I couldn’t get it working, probably due to my shortage of rigging knowledge.
Would you mind illustrating with a screen shot?

I was thinking that a floor constraint on a target would work better than limits… but I was wrong, limits work perfectly! here is a blend file!

nice one Ridix!



limit.blend (501 KB)

mathiasA, Thank you!
This is perfect!
I haven’t yet picked it apart to see how you did it, but first of all I just want to say thanks a lot!

OK, now I see basically how you did it. And now I understand what is meant by “limits”.

By the way, the visual aid that shows the limited axes (red for X, blue for Z, etc) is very helpful.
(I have to thank some Blender dev for that.)

Edit 2:
I was able to replicate your setup from scratch in a new file, so I think I understand it sufficiently.

Edit 3:
To answer part of my own question, by adding a Copy Location bone constraint to the target bone, pointed at an Empty, I can have the Empty control the orientation of the IK bone.
In simple English: I now know how to make the shaft of the ball point at an Empty.

Thanks again for sharing the .blend!

That looks cool, but way more elaborate

yeah, not really so elaborate. but i get what you mean. i’m glad you found a solution. :wink: