Dynamic bone is an must have asset from the Unity asset store, but it is not useful for all. In this post we will see where dynamic bone is used in game development and also if it is useful for you. What does it exactly mean to add physics to the character bones or joints and how is it different from character animation is what we are going to see. Link to current available offer on dynamic bone is available at the end of the post.
Difference between Unity Dynamic Bone and Animation
Animation is predefined motion of the character in a particular manner that is rigged already. But adding physics creates a responsive motion to the character based on the motion. To understand it better, Take a horse character. Walk, run and jump are animations rigged for the horse. If the animator has not considered the neck hair and tail during the rigging process then, those parts won’t move when the animation is played. When physics is applied to those parts, it starts moving based on the characters motion. This is what is done using dynamic bone is a simplified manner.
Advantages of Dynamic Bone
- Very easy to setup, Just buy and import the asset from the asset store.
- Easily add physics factors like elasticity, stiffness and damping factor to any bone you want within minutes.
- Works with Mecanim and legacy animation.
- Support all versions of Unity.
- Full source code included with the package, so you can make changes based on your requirement.
How to setup and use Dynamic Bones
- Prepare a properly setup character, both Mecanim and legacy rigs are supported.
- Select the game object you want to apply Dynamic Bone.
- In the component menu, select Dynamic Bone -> Dynamic Bone.
- In the inspector, select root object.
- Adjust dynamic bone parameters.
Parameters that you can adjust
Root:The root of the transform hierarchy to apply physics.
- Update Rate
Internal physics simulation rate, measures in frames per seconds.
Normal: Normal update.
AnimatePhysics: Updates during the physic loop in order to synchronized with the physics engine.
UnscaledTime: Updates independently of Time.timeScale.
How much the bones slowed down.
How much the force applied to return each bone to original orientation.
How much bone’s original orientation are preserved.
How much character’s position change is ignored in physics simulation.
How much the bones slowed down when collide.
Each bone can be a sphere to collide with colliders. Radius describe sphere’s size.
- Damping Distrib, Elasticity Distrib, Stiffness Distrib, Inert Distrib, Radius Distrib
How parameters change over hierarchy chain. Curve values are multiplied to corresponding parameters.
- End Length
If End Length is not zero, an extra bone is generated at the end of transform hierarchy,
length is multiplied by last two bone’s distance.
- End Offset
If End Offset is not zero, an extra bone is generated at the end of transform hierarchy,
offset is in character’s local space.
The force apply to bones, in world space. Partial force apply to character’s initial pose is cancelled out.
The force apply to bones, in world space.
Collider objects interact with the bones.
Bones exclude from physics simulation.
- Freeze Axis
Constrain bones to move on specified plane.
- Distant Disable, Reference Object, Distance To Object
Disable physics simulation automatically if character is far from camera or player.
If there is no reference object, default main camera is used.
Dynamic Bone Collider component description:
The center of the sphere or capsule, in the object’s local space.
The radius of the sphere or capsule, will be scaled by the transform’s scale.
The height of the capsule, including two half-spheres, will be scaled by the transform’s scale.
The axis of the capsule’s height.
Constrain bones to outside bound or inside bound.
Simple demo by VRChat on using Dynamic Bones
Dynamic bone is really useful for anybody making a 3D game. It is one the best assets from the asset store that all developers must include in their tool-set. You can just apply physics to any of your character and make it look more realistic in matter of minutes. When it comes to cloth and hair animation, dynamic bone is easily the best solution available in Unity. Its only $20 in the assets store and is definitely worth the price. You can check out the link below to see if any deals are available at the movement on this asset.