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

Weapon (component) driven animation methods.

Discussion in 'Animation' started by acecase, Oct 5, 2020.

  1. acecase

    acecase

    Joined:
    Mar 16, 2014
    Posts:
    7
    I'm positive the answer(s) to this is all over this forum and youtube, and many other places, but I don't know what to look for. I do this stuff as a hobby off and on, so I'm still pretty new to it.

    I'm curious if there are any interesting ways to implement weapon specific animations. For example, a shortsword vs. a great hammer in Salt and Sanctuary. I'm specifically interested in 2D, but it seems like a thing that would be similar in 2D and 3D.

    Obviously, skeletons could be animated for every possible combination of, say, weapon and shield, but I wonder if there is a way to have the weapon/shield drive the animation and have the player/enemy model "follow" that.

    Am I crazy?
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,486
    The Weapons example of Animancer (link in my signature) demonstrates how you can easily set up a component attached to your weapons which defines the animations a character will use when that weapon is equipped.
     
    acecase likes this.
  3. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,196
    That'd be an IK-based solution, but I don't think it'd look very good. Honestly it'd probably look more like a Landfall game than what you're going for.
    It might be possible to make it look good, but that's probably going to take a lot more work than to just animate the things from scratch.

    There is smart things you can do with masking - say you want the spear and sword to have different attacks, but want the shield arm to do the same thing in both instances. Then you could play a generic attack animation on the whole body, and use a mask to get the correct thing on the arm. Note that:
    - it won't look as good as bespoke full-body animations.
    - it won't save you that much work if the animator's decent, as your animator could use the previous animation as a starting point to make the new one, saving time that way.
    - It requires skeletal animation, which is mostly a 3D thing. There is skeletal animation available for 2D - but I kinda think that all just ends up looking like Helheim Hassle.
     
    acecase likes this.
  4. acecase

    acecase

    Joined:
    Mar 16, 2014
    Posts:
    7
    Thank you both. IK is what I needed to know to search for, so that alone has helped a lot. The Animancer example is a far more advanced version of another idea I had, but for what I'm playing with now, I'm actually going for a "weapon controls the player" feel where the player will be almost a ragdoll being dragged around by the weapons. Again, just a hobby.