Search Unity

Good practice for animating your character?

Discussion in 'Animation' started by PatHasNoPot, May 30, 2018.

  1. PatHasNoPot

    PatHasNoPot

    Joined:
    Oct 10, 2016
    Posts:
    7
    Hello Everyone,

    I'm currently working on a Battle Royale kind of game, and I've been dealing with some issues with the animation, to which I would appreciate any sort of feedback on the "Good practices" of what to do/what not to do.

    The characters are in Humanoid.
    A) Our characters can walk, run in every direction except backwards, crouch, jump, and lay down
    B) And while applying these states, I would want the character to have the option to attack (attacking while laying down/crouching/jumping/walking, not running)
    C) The characters have a bow, which is a simple rendered object without a BlendState. I would also need to animate the aim, and the shooting of an arrow

    A:
    ---
    I have figured out A by applying the below
    > Blend tree for walking, which includes running
    > Blend tree for crouching
    > 2 Animation States for jumping (one while walking/idle, one while running)
    > Blend tree for laying down

    B:
    ---
    However, I'm having difficulties with B. I do have the animations for attacking, however they'd only work while I'm standing, and it would neglect any other movement.
    I have heard of "IK", but I haven't found any detailed instructions about it, but I use an asset for animations that has an Animation Layer with it, and I seem to be able to use both layers at the same time.

    Is that the correct way of implementing it? Or are there alternative, better solutions?

    C:
    ---
    Do I need blendstates to make the bow more convenient and have it bend when I'm pulling it? Or is there another proper way to deal with this?

    I will post any update I might find, to further enhance this thread and make it helpful for the future, but in the mean time, do not hesitate to throw in your practical 2 cents opinions!

    Thank you for reading, have a nice day!
     
  2. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    551
    You can try using avatar masks https://docs.unity3d.com/ru/current/Manual/class-AvatarMask.html to make your attack animations affect only arms/upper body for example. Though considering how different standing and laying poses are, it may not work well. You may need specific attack animations for all of your stances after all
     
  3. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    If you want high quality - create attack animations for each situational position/motion (crouching/laying/jumping/walking/running). Each position creates different body states which will be extremely difficult to make look good with additive/override layering in any engine.
    The best quality would be unique animations for each position/motion.
     
  4. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Yep. Good advice.
    Because that's kinda like the way, they do it in fighting games too. :)
    Virtua Fighter etc. is a good example of that.
     
    Last edited: Jul 1, 2018
  5. PatHasNoPot

    PatHasNoPot

    Joined:
    Oct 10, 2016
    Posts:
    7
    Hey DimitriX89, that's what I've been doing already.
    I have an original layer for the movements
    And a different layer for the weapon's special movements (which are the attack/idle/reload/recharge if needed), which are applied with an Avatar Mask.


    Is this really the best option tho? This would produce a lot of data generation considering I have 30 different characters
     
  6. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    "best" is subjective and doesn't relate to the amount of data required. For "best" unique animations will always be better than re-purposing animations for a right side to a left side, or attempting to match a lower body motion with an upper body masked motion.
    For concern related to animation data might consider loading/unloading animation data at run-time based on the selected character. I'm sure that his how most fighting games optimize animation data.