Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

what is the good practice to animate a humanoid character with weapons

Discussion in 'Animation' started by Opeth001, Mar 17, 2020.

  1. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,068
    Hello Everyone,
    im making a Top-Down game, it's my first experience of animating characters.
    for the moment we have basic locomotion animations which are working correctly and we need to add weapons to these animations, like running with a Gun/Rifle/Sniper/Rocket ...

    our basic idea is to make 3 layers :
    1) player basic locomation (Walk,Run..) and Aim Locomation (Walk Aim). this layer is for the Character Lower Body.

    2) Hands Only : this layer is for the Character hands to hold the weapon correctly while idle or running... (can be mixed with the Layer 1).

    3) upper body layer: this layer is used for Aim and Shoot Animation, applied to the Upper Body only. (can be mixed with the Layer 1).

    My Questions:

    1/ is it the Correct way of doing it or there is another common and easier way ?

    2/we are currently faced with unexpected animations behaviour where the weapon is not correctly positioned for the character bring aiming but correctly positioned when his running. do we have to change the position of the weapon according to the animation or do we have to add another bone for the weapon in order to modify its position for each animation? (we are using humanoid types).

    Thanks in advance!
     
  2. SethMeshko

    SethMeshko

    Joined:
    Sep 20, 2014
    Posts:
    109
    Unity is pretty bad about coordinating animators from different objects. For some reason even though they should be starting on the same frame and animating in the same time it appears they may not play at the same time or speed. The way I have dealt with this is to parent the prop into the character hierarchy.
     
    Opeth001 likes this.
  3. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,068
    this should be the response for my 2 question :).
    so the correct way of doing it is adding an additional bone for the weapon and do everything in the same animation ?
     
  4. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,068
    Hello Again.
    we still have a big problem.
    by mixing the 2 first animations the character hands are wrongly placed + aiming the wrong direction.

    BaseLayer: LowerBoddy (Walk_Left) + SecondLayer: UpperBody (Aim_Forward)
    +

    it gives this wrong result


    any suggestion will be highly appreciated!
     
  5. SethMeshko

    SethMeshko

    Joined:
    Sep 20, 2014
    Posts:
    109
    It depends on how complex the animation on the weapon is. You could place a "socket joint" in the hierarchy and dynamically parent the weapon to the socket joint. And yes if you need that to animate then you would key the socket joint as part of the clip. Or you may want to consider some light dynamics on the weapon to get the secondary motion you are looking for if you need different weapons.
     
  6. SethMeshko

    SethMeshko

    Joined:
    Sep 20, 2014
    Posts:
    109
    As far as the hands go, is that the result of animation blending between two states?
     
    Opeth001 likes this.
  7. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,068
    it's the result of 2 Layers maxing (UpperBody and LowerBody).
     
  8. ArinFaraj

    ArinFaraj

    Joined:
    Jan 5, 2014
    Posts:
    13
    have you found a good way to do it?
    because i'm actually having the same thing with my project
    my goal is to have 1 animation system for both fps and tps
    also want to able to change characters and have the same sort of weapon animations

    i was thinking about using generic but im not so sure if its a good idea if i want to have characters with different sizes