I’m going through the process of trying to make a tail that’s controlled through physics and hinge joints, even though the rest of the character has the bones hand-animated. This is the process I want to use, let me know if there’s any problem with it:
- import character with armature
- using a script, add hinge joints, rigidbodies, and colliders to each bone of the tail
- resize the colliders appropriately through script
- put proper settings on hinge joints for springs, limits, etc.
Is there anything I’m missing? Do I have to do something special so that the bones know that they aren’t controlled by any animation? I was looking at AnimationState.AddMixingTransform to only affect the bones I want for animation… am I going in the right direction here?
OK… I’ve solved my own problem. I didn’t need the AddMixingTransform stuff after all. Here were my basic steps (in case someone’s looking for this later).
- I imported my character with the armature (skeleton).
- I created a script that added a collider, rigidbody, and hinge joint to each part of the tail.
- The script also added a rigidbody to the bone the tail was connected to, and made that rigidbody kinematic.
- The colliders were properly resized, repositioned, and give the proper axis (x-axis, in my case).
- The script connected the hinge joints to each other up the chain, and then added limits to the hinge joints.
- The axis of the hinge joints was adjusted so that the hinge would rotate in the correct way (hinge joints only rotate along one axis).
That was pretty much it. The body can now animate in whatever way I want it too, and the tail moves fairly well, all without breaking the original connection to the imported FBX file.
1 Like
Thanks for posting this! I just came by to look for this exact information.
… and it doesn’t work for me. The only difference I have is that I’m using a Character Joint rather than a Hinge Joint. Otherwise it’s about the same. There’s no movement from the bone at all.
Any thoughts?
I am glad you posted this, I hope that this works for our project as well.
Thanks,
That sounds about right. I did this for the physics based ribbon in Physynth that flops down on the help screen. The only really tricky part is that you will need to make them all kinematic if you want to reset or move the character, and it’s also quite fiddly getting a decent hinge joint setup that actually doesn’t spaz out.