snake game revisit, some doubts in it in joints

Is it possible to use hinge joint between two spheres, i tried of that but its not working. But it is working in between sphere and cylinder. Can any one tell me how two do that. And the body parts are moving with the head but they are not turning around.


The shape of the mesh you apply joints to shouldn't affect it so much.

I usually only rely on configurable joints, to build a "hinge" joint, it gives you more options and flexibility. If using a configurable joint doesn't work, make a comment, and I'll post a small working example.



Check the axis of hinge rotation. It starts as (1,0,0). If sphere #2 is behind #1, that will make it hinge up/down. If #2 is next to #1, it will hinge by twisting, which you won't even see on a sphere. Try (0,1,0), meaning it hinges around a straight up line, like a door. When you click in the Inspector, the orange arrow shows the hinge axis.

To test, try manually pulling the first one in scene view while running. If needed, select sphere #2 and check the rotation.

Adjust the anchor numbers, as well. It starts at (0, 0.5, 0) which effectively gives a center to center connection (#2 will appear to "roll around" #1.) Changing x or z would give a "glued to the side" effect. The orange Inspector arrow also shows this position.

FYI, you don't have to have two 0's and a 1. (0,65,0) is also straight up. (1,0,1) hinges around a line drawn NE.

If you have a 3D snake, where the top can go L/R or up/down hills, a characterJoint might be better.