Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Dynamic Bone - Realistic swaying ponytail and bouncing boobs

Discussion in 'Assets and Asset Store' started by HorngYuiWei, May 11, 2014.

  1. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    Dynamic Bone apply physics to character's bones or joints.
    With simple setup, your character's hair, cloth, breasts or any part will move realistically.

    Features
    - Very easy to setup, no programming required.
    - Fast and stable physics simulation.
    - Works with Mecanim and legacy animation.
    - Support all versions of Unity, including mobile and WebGL.
    - Full source code included.
    New Features in 1.3
    - Add "Roots" parameter to setup multiple root transforms.
    - Add "Blend Weight" parameter to control how physics blends with existing animation.
    - Collider add enable/disable check box.
    - Collider add "Radius 2" to setup capsules of two radii.
    - Use multithread to improve physics simulation performance.
    - Parameters can be animated with Unity animation system.

    Asset Store
    Video

    If you are not sure is Dynamic Bone works for you, please mail willhongcom@gmail.com to request for an evaluation version.

     
    Last edited: Nov 26, 2022
    Lex4art, Ony, DotTeam and 1 other person like this.
  2. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I'm glad to see this asset now has a thread, and the forum thread has a link on the asset store! I always look for that, because I want to read up on each asset before I buy it.
     
    ChristopherKerr likes this.
  3. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    If you are not sure if Dynamic Bone works for you, please mail to willhongcom@gmail.com to request an evaluation version.
     
    Last edited: May 13, 2014
    ChristopherKerr likes this.
  4. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    Have you tested mobile performance?
     
  5. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    Dynamic Bone uses its own physics simulation, which is simpler and much faster than Unity's build-in physics system.
     
    Antti2 likes this.
  6. Yudhi

    Yudhi

    Joined:
    May 28, 2013
    Posts:
    4
    Is this working only for humanoid characters? Can I import from Blender characters?
     
  7. Yudhi

    Yudhi

    Joined:
    May 28, 2013
    Posts:
    4
    Forgot to ask a few more questions: Can I import characters from Mixamo FUSE? and How about video tutorials?
     
  8. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    Dynamic Bone works for any character, the only requirement is the part you want to apply physics must have bones.
    Setup is very easy:
    1. Select you character.
    2. From Component menu, select Dynamic Bone.
    3. In inspector, choose the bone you want to animate as "Root"
     
  9. Amaresh

    Amaresh

    Joined:
    Jan 22, 2014
    Posts:
    21
    Do we need to have bones in our character before using it?
     
  10. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    Yes, characters should be rigged in 3D software.
     
  11. Skyfly

    Skyfly

    Joined:
    Jan 25, 2014
    Posts:
    110
    Can this be used for things like a swinging chain or cables (two fixpoints)?
     
  12. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    For Ponytail or tail do you select the chain then apply Dynamic Bone to that?

    Also is there an effect slider to adjust the weight to blend Dynamic with keyframed animation for secondary motion.

    Also any plans to make some playmaker actions to change weights in runtime?
     
    XCO likes this.
  13. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    No, Dynamic Bone has only one fixed point (the "Root").
     
  14. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    You can change weights in runtime by call the component's public method SetWeight().
     
  15. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    Hey Will Hong, just bought DynamicBone, looks awesome, but there is a requirement to upgrade to Unity 4.5.
    I'm still using Unity 4.3.4 and dont want to upgrade until i finish a couple of projects. Is there something specific about 4.5 that you're using? Can you lower the requirement for Unity version?

    Thank you in advance!
     
    Last edited: Jun 12, 2014
  16. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    Hi,
    Dynamic Bone works fine in Unity 4.3.4.
    I'll use lower version of Unity to submit to asset store next time.
     
  17. nukeD

    nukeD

    Joined:
    Feb 12, 2009
    Posts:
    411
    I thought so, thanks man !
    edit: somehow unity got confused and let me download it :rolleyes:
     
    Last edited: Jun 12, 2014
  18. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,203
    This works great, much simpler to setup than the solution I had cobbled up (involving springs and colliders). Thanks!
     
  19. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    230
    This seems pretty good so far for adding some small character details.

    I also imported a plane with bones and got it kinda working as moving cloth. Only thing is I can only get that working if it's attached to a base object that is always in motion.

    For something like blowing curtains adding forces doesn't seem to work with the physics (it just makes the plane rotate?) Is there a way to do that?

    edit: nm found one way to do it using a hinge and then colliders that you make the mesh invisible.
     
    Last edited: Jun 12, 2014
  20. Ghosthowl

    Ghosthowl

    Joined:
    Feb 2, 2014
    Posts:
    228
    Can you give a quick run down on how you should go about adding bones for breasts so that this system will be affected by it properly? We tried to add one on to our model but it doesn't seem to be doing much. Messing with the settings to the extreme causes them to vibrate but we can get no where near the effect you achieve in the demo.
     
    SureSight likes this.
  21. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    Dynamic Bone requires at least two bones to simulate.
    If you have only one bone for breasts, you can try to set "End Length" or "End Offset".
    An extra bone is generated at end of chain. It should move correctly.
     
  22. yuewahchan

    yuewahchan

    Joined:
    Jul 2, 2012
    Posts:
    309
    can you have more example to show off dynamic hair, cloth etc ?
     
  23. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    Dynamic Bone is not designed for precise cloth simulation. If you add bones to swaying part of clothes or hairs and let Dynamic Bone animate the bones, it should look good enough.
    I'll make more demos to show off it's capability.
     
    Last edited: Jun 14, 2014
  24. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Hi HorngYuiWei, I just bought your asset and I have to say that so far I'm loving it! :) Very simple to use and to setup (although a couple of tutorials would be a nice addition, especially regarding cloth).

    I have a request: do you think it would be possible for you to add a "Weight" slider on the component itself? Something that would do what "SetWeight()" does but interactively so the user can check the results in real-time...
     
    Alverik likes this.
  25. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    SetWeight() just modify "Stiffness" with some additional code to ensure it can be changed in runtime.
    You can drag "Stiffness" slider from current value to 1 to see the result.
     
  26. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Oh I see. Thanks for your reply!
     
  27. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    Hello, I'm using this plugin for the movement of the head on a racing game. It works very well, but I'd like to apply the dynamic bone the the spine, and not only to the neck, so that also the chest will move a little. The problem is that the Mecanim IK for the hands got overridden by Dynamic Bone and the hands are not sticked to the steering wheel anymore. Do you suggest some solution for this?
    Thanks.
     
  28. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    Hi,
    You can try to use the "Exclusions" feature of Dynamic Bone.
    Add bones you don't want to apply physics to "Exclusions" list.
    In your case, may be left and right shoulder bones.
    So the whole hierarchy chain from shoulder to hand will not be effected by physics.
    Mecanim IK should work as usual.
     
    Last edited: Sep 11, 2014
  29. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    I tried that but the arms are rigid and get moved based on the spine bones rotation. It seams that IK is applied before, and then DynamicBone rotate the bones.
     
  30. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    Hi,
    I tried it and get same result. As you said, IK is applied before dynamic bone.
    Unity does not have the function to let me modify animation before IK.
    You may need to use other IK solution then use Script Execution Order settings to define their execution order.
     
  31. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    FinalIK is an excellent solution for IK and has great support...
     
  32. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    580
    @HorngYuiWei Yes I was supposing that
    @Licarell Thank you. I already have it in my wish list, but I was hoping to use the features of Unity Pro...
     
  33. MABManZ

    MABManZ

    Joined:
    Sep 29, 2011
    Posts:
    144
    I bought this and can't get it to do anything with my rig setup. I'm using legacy animation, and trying to set up a short ponytail piece of hair. When I attach the script to the root of the hierarchy, nothing happens. The hair is NOT part of the rigged and animated hierarchy, either.

    The included demo scene appears to be broken, also. It doesn't animate, the tail is completely missing, and the UI doesn't work??? The camera is not even positioned correctly

    I'm using Unity 4.5.1f3, if that makes a difference
     
  34. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    Hi,
    I'm not sure what happened with your setup. Dynamic Bone works well with legacy animation and the demo scene should works of course.
    Please give me more information or send a simple scene to willhongcom@gmail.com
    So I can help you to solve the problems.
     
  35. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    @HorngYuiWei Hi, I encountered a bug when adding the DynamicBone component via scripting (not manually). The value for m_Exclusions (at line 291) for some reason ends up causing an endless stream of errors. So I simply added a test for null like so:

    if (m_Exclusions != null)
    {
    ...


    And now everything's fine. Do you think you could include that fix in the next release by any chance? Cheers! Love the asset! :)
     
  36. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    Thanks,
    I'll add the fix in next release.
    You may also check "m_Colliders" at line 420, It may cause similar problem if your add via scripting.
     
  37. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    You're right, thanks for the heads up!
     
  38. GlitchInTheMatrix

    GlitchInTheMatrix

    Joined:
    Apr 12, 2010
    Posts:
    285
    Im Using it in a cape and want to add collide to the body, to collide there, the only way is adding those spheres (Dynamic Bones Collider)? Where i should add the collider? to the body of my character?

    thanks
     
  39. GlitchInTheMatrix

    GlitchInTheMatrix

    Joined:
    Apr 12, 2010
    Posts:
    285
    The movement is just what im looking but the collide with the body don't work's well. The cape just ignore the yellow sphere ( I attached it to the Colliders )

     
  40. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    You can add Dynamic Bone Collider (sphere or capsule) to character's chest or hips.
    By default, dynamic bones will keep out of the colliders.
    If it still don't work well, you can try to add collider behind character's chest and set collider's "Bound" to Inside.
    Dynamic bones will keep inside of the colliders.
    You can also increase dynamic bone's "Inert", so character's movement are partially ignored in physics simulation.
     
  41. GlitchInTheMatrix

    GlitchInTheMatrix

    Joined:
    Apr 12, 2010
    Posts:
    285
    Thanks HYW, This Asset is really helpfull and didn't notice any difference in my framerate. Great Job pal!
     
  42. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    @HorngYuiWei Hi, I stumbled upon another bug while using DynamicBone: when creating the components via scripting I get null errors in DynamicBone.cs (starting at line 223). To get rid of those I just had to check against null like so:

    (sorry but the formatting is destroyed by the forum post :( )


    Code (CSharp):
    1.   if (m_BoneTotalLength > 0)
    2.   {
    3.   float a = p.m_BoneLength / m_BoneTotalLength;
    4.   if (m_DampingDistrib != null)
    5.   {
    6.   if (m_DampingDistrib.keys.Length > 0)
    7.   p.m_Damping *= m_DampingDistrib.Evaluate(a);
    8.   }
    9.   if (m_ElasticityDistrib != null)
    10.   {
    11.   if (m_ElasticityDistrib.keys.Length > 0)
    12.   p.m_Elasticity *= m_ElasticityDistrib.Evaluate(a);
    13.   }
    14.   if (m_StiffnessDistrib != null)
    15.   {
    16.   if (m_StiffnessDistrib.keys.Length > 0)
    17.   p.m_Stiffness *= m_StiffnessDistrib.Evaluate(a);
    18.   }
    19.   if (m_InertDistrib != null)
    20.   {
    21.   if (m_InertDistrib.keys.Length > 0)
    22.   p.m_Inert *= m_InertDistrib.Evaluate(a);
    23.   }
    24.   if (m_RadiusDistrib != null)
    25.   {
    26.   if (m_RadiusDistrib.keys.Length > 0)
    27.   p.m_Radius *= m_RadiusDistrib.Evaluate(a);
    28.   }
    29.   }
    Do you think you could include those changes in the next version please? Cheers!
     
  43. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    Hope you don't mind, but I wrote a shorter version of your code:

    Code (CSharp):
    1. if (m_BoneTotalLength > 0)
    2. {
    3.     float a = p.m_BoneLength / m_BoneTotalLength;
    4.     if (m_DampingDistrib != null && m_DampingDistrib.keys.Length > 0) p.m_Damping *= m_DampingDistrib.Evaluate(a);
    5.     if (m_ElasticityDistrib != null && m_ElasticityDistrib.keys.Length > 0) p.m_Elasticity *= m_ElasticityDistrib.Evaluate(a);
    6.     if (m_StiffnessDistrib != null && m_StiffnessDistrib.keys.Length > 0) p.m_Stiffness *= m_StiffnessDistrib.Evaluate(a);
    7.     if (m_InertDistrib != null && m_InertDistrib.keys.Length > 0) p.m_Inert *= m_InertDistrib.Evaluate(a);
    8.     if (m_RadiusDistrib != null && m_RadiusDistrib.keys.Length > 0) p.m_Radius *= m_RadiusDistrib.Evaluate(a);
    9. }
     
    Last edited: Nov 23, 2014
  44. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    No problem, thanks! :)
     
  45. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    Thanks,
    I'll add these checks in next release.
     
    OnePxl and hopeful like this.
  46. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
  47. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
  48. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    585
    I have purchased your asset, and I like it very much.
    I have one question: I am not sure if I did something wrong, but I have a crawling / crouching woman, and in this case, the breasts do not swing naturally while they do perfectly when she is in an up-right position and jumping up and down.
    Do you think I made a mistake, or do you think it might be an unexpected situation in your dynamic bone script?
     
  49. HorngYuiWei

    HorngYuiWei

    Joined:
    Apr 27, 2014
    Posts:
    174
    Hi,
    You can try to reduce "Inert" parameter.
    If it still not works well, please send a simple file to willhongcom@gmail.com so I can see what's wrong with it.
     
  50. LysolPionex

    LysolPionex

    Joined:
    Mar 22, 2013
    Posts:
    2
    I have a character that will uses a whip. As he's walking, I'd like the whip to use this plugin, but then go into an animation when he's swinging from something with the whip, or when attacking with the whip. How would this work with an animation? Would the animation override it, or would Unity try to blend them? Ideally, it would blend the two, but I'd have the ability to disable the dynamic bone plugin if needed.