Search Unity

  1. We've closed the job boards. If you're looking for work, or looking to hire check out Unity Connect. You can see more information here.
    Dismiss Notice
  2. Unity 2017.2 is now released.
    Dismiss Notice
  3. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  4. If you're a macOS 10.13 High Sierra user take be sure to read this before updating Unity.
    Dismiss Notice
  5. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  7. Unity 2017.3 beta is now available for download.
    Dismiss Notice

To Use physic on several characters bones question

Discussion in 'Physics' started by mr_Necturus, Dec 4, 2017.

  1. mr_Necturus

    mr_Necturus

    Joined:
    May 17, 2010
    Posts:
    2,682
    Hey Guys.

    I created warrior character with skirt.
    The skirt is one object but actually present 18 armored leather strips.

    This strips have to move independently, so each strip skinned to its own personal bone. (As you can see on video)


    I provide many animations with this character. But I don't want to animate those strips.
    There are 2 reasons for this:
    1. It is much boring work.
    2. If someone will want to use extra animations with this warrior, say from animation collections found on Unity Market, the strips will no be animated.

    Physic solve both problems.

    Is here a way to make something like I am looking for?

    I will be grateful for tips and explanations.
     
  2. mr_Necturus

    mr_Necturus

    Joined:
    May 17, 2010
    Posts:
    2,682
  3. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    20,382
    [​IMG]

    Perhaps you should fix the video you posted 30 mins ago first...
     
    mr_Necturus likes this.
  4. mr_Necturus

    mr_Necturus

    Joined:
    May 17, 2010
    Posts:
    2,682
    Sorry, forgot to public the video.
    Now it is visible?
     
  5. mr_Necturus

    mr_Necturus

    Joined:
    May 17, 2010
    Posts:
    2,682
    Here I tried to make same setup like in tutorial. But physic didn't work.
    Maybe I miss something small?

     
  6. mr_Necturus

    mr_Necturus

    Joined:
    May 17, 2010
    Posts:
    2,682
    No solution, no help... :(
     
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    20,382
    Well it's basically the problem is you're not really familiar with physx. I'm guessing you want the leg to move the clothing, so you can either paint the clothing bits as stiff cloth, or you can go with this current solution but joints are a nightmare to set up in Unity (it's considerably easier in UE4 to make sense of them plus dedicated animation joints) so in Unity you need to be looking at how ragdolls are set up. It's a similar thing I guess.

    In my game, I coded secondary motion manually and it works - kind of, still need to get it working on other axis :)

    I hope someone can chip in with some knowledge of a basic joint set up - perhaps @Partel-Lang feels charitable? He's one of the best of the best at this stuff!
     
  8. mr_Necturus

    mr_Necturus

    Joined:
    May 17, 2010
    Posts:
    2,682
    Thank you!

    Actually stiff cloth if it will may be stiff as leather or metal will work for me.
    I will try it.

    I have much experience with rigid bodies and clothes physic in MAX or Maya. I even worked with Syflex - most successful clothes plugin for Maya 15 yeas ago. )



    So I know pretty well how all generally works.
    I don't familiar what things I need to tweak in Unity in order things will work properly or will work at all. )
     
  9. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    20,382
    All you do is add cloth component direct to the mesh you desire, then colliders - its straightforward but fiddly. It's good for performance as people fade it out after. This is ideal (or physics are ideal) if the anims will be changing. I guess you have clothing as a separate object? It doesn't matter to cloth which can go on skinned or separate objects.

    https://docs.unity3d.com/Manual/class-Cloth.html
     
    mr_Necturus likes this.
  10. mr_Necturus

    mr_Necturus

    Joined:
    May 17, 2010
    Posts:
    2,682
    Thanks!

    Yes, I made skirt as separate object because planned to use physic with it.
    I will test it soon when I have free time and public result here.
     
  11. mr_Necturus

    mr_Necturus

    Joined:
    May 17, 2010
    Posts:
    2,682
    Hm... Thank you for help hippocoder.
    The result far from ideal so far. At least in Unity 5.1
    It seams I will prefer to create animations for skirt by hand.
     
  12. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    20,382
    Using physx or cloth for attachment-type things is not optimal, it's the reason I developed my own joint physics and the reason UE4 and other engines have a dedicated physics animation library, so you can do these things faster and easier.

    Using physx was always going to be a problem for you (your first approach) because:
    - people use different physics settings than you
    - people have layers set up different to you

    Using cloth is still feasible but you have to be really fiddly with it and cloth only improves in newer beta.
     
  13. mr_Necturus

    mr_Necturus

    Joined:
    May 17, 2010
    Posts:
    2,682
    I agree. But here is my point why I decided to stick with handmade key animations in first release.

    1. It gives maybe not very realistic but still suitable result.
    2. This approach don't need fixes in later Unity versions if something will be changed in physic engine.
    3. If someone will want to use external animations, he can do it by creating his own physic setup. So I will not be responsible for wrong or strange physic behavior.
    4. Once when physic will looks better I can also create physic model setup if I want.
     
  14. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    20,382
    Now if only Unity was working on jiggle bone physics :rolleyes:
     
  15. mr_Necturus

    mr_Necturus

    Joined:
    May 17, 2010
    Posts:
    2,682
    Here is result of hand made skirt animation (2,5 days work).
    Looks closer to realistic view then clothes physic, for my opinion.