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

How do you aim a sword swing such that the blade hits a certain point?

Discussion in 'Animation' started by DungeonBrickStudios, Jun 28, 2020.

  1. DungeonBrickStudios

    DungeonBrickStudios

    Joined:
    Jun 9, 2015
    Posts:
    69
    Hi guys, I'm pretty much looking for the exact behavior seen in this video.

    You have a specific point in the game and the weapon hits exactly that point. I already have some animations for sword swings/attacks, but I just want to know how I would go about this. I've already done quite a bit of searching, but I haven't found material on exactly this. Any hints would be greatly appreciated. I know it's related to IK and I've seen some videos on that, but I still am not sure how to go about this.
     
  2. LegendaryShark

    LegendaryShark

    Joined:
    Jan 26, 2020
    Posts:
    2
    Same problem. Did research and not found anything yet.
     
  3. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,074
    Could you go into more detail, what you mean by this?
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,754
    For example swing sword from right and hitting enemy leg, or aimin in torso, or parrying enemy attack. Hence blade of sword is contacting with target point.

    The easiest aproach is, to have predefined set of animations, for full attacks.
    Then level up, having part of animation, of upper body, or arms, swinging the sword.
    Then next level would probably blending, given animations.

    Other option is, to have IK driven animations.
    But then you would need to play with joints weights and dynamics of the swings, including desired weapon orientation, etc.

    See also cinemchine. I don't know, wHlhat current state is however.
     
  5. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,074
    Okay. I understand now. I had a slight suspicion it was that. But when he said, "You have a specific point in the game," I was wondering if it was for a cutscene or something.
     
  6. LegendaryShark

    LegendaryShark

    Joined:
    Jan 26, 2020
    Posts:
    2
    He means like a crosshair. The player aims exactly somewhere, let's say the head of an enemy, and the animation redirects and the sword swings exactly there.