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

Resolved Import humanoid workflow

Discussion in 'Animation' started by Siro13, Jan 1, 2021.

  1. Siro13

    Siro13

    Joined:
    Jun 30, 2014
    Posts:
    33
    Hello everyone,
    I have searched the whole forum, but I am more and more confused.
    With Blender I completed the rigging of my character who uses a stick as a weapon and no problem.
    I imported the character as Humanoid, I saw the extra bones in the mask section, but the stick does not move.
    My question is:
    is there a tutorial explaining how to create a character with weapons and how to properly import it into unity?
    I've only found tons of tutorials on how to create, rig and animate any character, but I can't find anything about how to "properly" import the character plus a one-handed or two-handed weapon.

    I see these: https://learn.unity.com/project/game-character-animation-in-unity-and-maya ( but it does not show how to import the sword )

    I know that using the Generic type, the animation works, but I have a loss of performance so I would like to use the Humanoid type to have better performance and to be able to use retargeting.

    Can anyone help me please?
    I have to overcome this obstacle to be able to continue my project.
    Thanks
     
  2. Siro13

    Siro13

    Joined:
    Jun 30, 2014
    Posts:
    33
    Hello,
    I don't want to be rude, but I don't understand why no one answers a basic request like mine.
    I believe that it is common to have to animate a character who is holding a weapon or an object.
    So if no one answers it means that the forum has no sense to exist or I am doing something wrong.
    However, with a view to sharing, here is my experience:
    With Blender + rigify I created an animation of a character holding a weapon with 2 hands.
    I exported the character + animation
    then
    I exported the weapon separately.
    The character is of the Humanoid type and in the animation-> mask section:
    "Create from this model" -> transform-> check weapon bone (disabled by default)

    If I left the Generic type rig, it would be easier, but reading around it seems to be a poorly performing solution.

    I don't know if that's the best solution.
    I don't even know if there are other solutions, so I asked the forum for help.

    I hope it will be useful to someone.

    Thanks
    Greetings
     
  3. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    It's been a while since I did this, so I go by memory.
    Humanoid support extra bones such as tail, cloth or even weapon but it doesn't do retargeting so they will have the exact same rotation as the original animation and it may look off in some cases.
    To work the bone in the original animation and the retarget humanoid must have a match 1:1 so if the original has the following path for example : hips-spine-chest-leftshoulder-leftarm-hand-weapon attach
    then even the destination mesh must have the same bone with the same exact names or it won't work.
    I don't remember if you are required to click optimize game object and manually select the extra bones, maybe not, but try it if it doesn't work.
    Also check the animation window when the animation is playing to check if it has trouble locating some bone.
    If the weapon doesn't need to have any animation, but must simply follow the hand, you can simply parent the weapon to the hand bone at runtime or in the editor.
     
  4. Siro13

    Siro13

    Joined:
    Jun 30, 2014
    Posts:
    33
    Hi 00christian00,
    Thank you for your answer.
    As I wrote in my previous Post, I finally managed to figure out how to import Humanoid type animation with the addition of weapons.
    The thing that leaves me very very very perplexed is the total lack of a minimum explanation, I mean from the unity staff, regarding this topic.
    There are only very basic things, with a very large range of options but without practical examples.
    It almost seems like they want to say: Ok I give you everything you need to do what you want, but how to do it ... you have to find out for yourself :D