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

[Help Wanted] Recreating Vertical Aim Rig: Katana in animation rigging blog post

Discussion in 'Animation Rigging' started by tubbz0r, Apr 27, 2020.

  1. tubbz0r

    tubbz0r

    Joined:
    May 24, 2014
    Posts:
    72
    Hi guys,

    I'm currently playing around with the animation rigging package and trying to understand how exactly to reproduce what was done in the vertical aim rig katana example done in the blog post made some time ago.
    Link: https://blogs.unity3d.com/2019/05/1...ion-rigging-preview-package-for-unity-2019-1/

    I've followed the steps for the shurikens in the example above and thats great but there however they do seem abit vague explanation for the katana example.

    Currently I've setup the virtual bone as the sword IK and moved it out in front of my players sword, created a new gameobject and childed that to my child rig and attached a multi-aim constraint. set the source object as the hand bone, set the sword object childed to the hand bone. Added another virtual bone and set the sword IK as a child to this new virtual bone. I added a position constraint to the new virtual bone to one of the spine bones in my characters (so it's centered on the chest). When I run the game, the sword just spins and spazzes out all over the place! I'm sure im doing something wrong as I may have misunderstood the document.



    Has anyone gone through this process / know how to do this correctly?

    Thanks!
     
  2. tubbz0r

    tubbz0r

    Joined:
    May 24, 2014
    Posts:
    72
    Spent hours trying to get this to work. Made some progress but still no luck. The Multi-aim constraint has the hand bone as the constrained object and the source object is my SwordIKTarget transform. helpme!.png
     
  3. SpiccyMayonnaise

    SpiccyMayonnaise

    Joined:
    May 10, 2018
    Posts:
    22
    I don't know how well this would transfer to a sword, but in my third person shooter game, I had a similar issue with IK and aiming with my weapons.

    First, I had a virtual bone under the "upper chest" bone, which is where the weapons would get parented using a multi-parent constraint. This ensures that the motion from the upper chest gets transferred to the weapon, so that it doesn't look like the weapon is stuck in space.

    I had "target" transforms as children of my weapons, which dictated where the hand IK effectors and hints should go.

    Lastly, a multi-aim constraint on the virtual bone pointed at a target which made the weapon aim at the target also.

    As for the actual character looking around, I have an example project on my github here: https://github.com/SpiccyMayonnaise/animation-rigging-character-looking-around
    (This project doesn't contain any setup for weapons, just the character looking around)

    I wouldn't suggest parenting your sword to the character's hand directly, because this can cause problems. I have my weapons contained in a child transform of the animator, then position them with constraints.