Search Unity

Question Animation Rigging Multi-Aim Constraint Head Not Looking At Target

Discussion in 'Animation Rigging' started by XochiInteractive, May 3, 2021.

  1. XochiInteractive

    XochiInteractive

    Joined:
    May 21, 2018
    Posts:
    19
    MY GOAL:
    I'm trying to have my character look and follow the target with their head & chest. When the target is moved up, they should look up and so on.

    CURRENT RESULTS:
    Right now the player's head looks at the ground and is slightly angled to the left. Like this
    HeadTargetSetupXEnabled.PNG Now, as you can see I have the X in Constrained Axes enabled, if I disable it, it looks like it works. However, the player will not follow the target up/down. In this image below the target is up but the head stays looking forward. At least it doesn't bend and look at the ground so this is my temporary fix at the moment just to look left/right. LookUp.PNG
    HeadTargetSetup.PNG
    In the image above you can see the X is no longer enabled and it's just the Y enabled.

    MY RESEARCH:
    I set this up by following along the Brackey's tutorial (
    ) and this has been my result. I have rewatched it multiple times trying to see if there's something I'm doing incorrect. The model is a Humanoid model downloaded from the Unity Asset Store. The free character model came from this asset https://assetstore.unity.com/packag...person-controller-basic-locomotion-free-82048

    I came across this forum https://forum.unity.com/threads/ske...p-and-down-he-also-moves-side-to-side.860908/ but it seems like a very large work around just to get the head to look at a target. I would take this route if I planned on doing more with this; however, to be honest I plan on snapping my target to an enemy for when the player "locks on" to an enemy. Other than that, this won't be used.

    Also, I have reviewed the Unity Documentation. I did also try and change the Aim Axis from Y to every other option. Image below has X set to the Aim Axis, I've also tried -X axis as well and it can get to "look" right if I mess around with the offset values but does not function correclty. When you move the Target left/right it will work; however, it will not look up/down still even with X enabled. I have also enabled Z on Constrained Axis and that does not work either. I thought perhaps it was my model, so I imported a model from Mixamo and received the exact same results. Could this be a result of the animations I'm using?? Here's a link to the one's I'm using here
    upload_2021-5-3_10-49-30.png

    When I changed models, I did start this entire setup process all over including doing the Bone Renderer Setup and Rig Setup. The only thing I wonder is if the Animation you're using could mess with this process.

    EDIT: In one of my screenshots the bone is highlighted and it looks like the multi-aim constraint is attached to the bone but it's not. The Target, HeadRot, & ChestRot are all separate GameObjects and the multi-aim constraint is on the HeadRot & Chest rot, not on any of the bones.
     
    Last edited: May 4, 2021
  2. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    I know your pain.
    I am experiencing this strange failure also.
    What I have noticed is the Unity demos work because they use plain gameobjects.
    My FBX are a total mess in this process.
    My next attempt is to extract the biped from the model to plain gameobjects and work from there.
    The break seams to be in complex models. I have just spent 2 months with FinalIk and Unity Anim.
    I spent the last year with FBXs and Blender Rigify / Rigify to Unity but the process broke things along the way.
    I am hoping the next extraction will clear things up.
    Unity's GO models works great in the animation timeline.
    To be honest I dont want anims, just ability to IK pose.
    My question to you and others is there a good FBX splitter into Unity process or asset?
    I hope what I have offered here helps.
     
  3. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    Don't put your components on your actual bones, it is much better to create new empty transforms as a sibling of your bone hierarchy and build your rigs with that. Not only will that give you a clearer overview of where you're modifying things, but it will also allow you control the order of operations of your constraints and such. This might already be the source of your problem, since your Multi-Aim Constraint might be executed and then overridden by something else.
    I've been working on something similar to what you want and got it (mostly) working with this workflow.

    Looking at the rest of your setup, if the move gizmo in your screenshot lines up to your bone axis (so you've turned on local gimbal drawing instead of global) then your aim axis should be Z.
     
    FluffytheKami and brainwipe like this.
  4. XochiInteractive

    XochiInteractive

    Joined:
    May 21, 2018
    Posts:
    19
    I'm sorry I should have mentioned this in my original post, the inspector window is locked while the bone is highlighted so I could show off my settings and what the bone looks like in scene view highlighted. My Target, HeadRot, & ChestRot are all seperate gameobjects. The multi-aim constraint is on the ChestRot & HeadRot gameobject while the Target gameobject is an empty gameobject with the Animation Rigging gizmo setup exactly how Brackey's set his up. I'll add this info into my original post so other's will know as well. Thank you!
     
  5. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    @Yandalf You have achieved 'Golden Child of Wisdom Award'!
    This little trick alleviates a lot of errors
     
    ChrisP999 likes this.
  6. pedroone

    pedroone

    Joined:
    Oct 15, 2017
    Posts:
    2
    Did you find the solution to you problem?
     
  7. XochiInteractive

    XochiInteractive

    Joined:
    May 21, 2018
    Posts:
    19
    Sorry for a delayed response but sadly no. This is mainly due to after working on my project my HDD crashed and I had to restart the project from scratch. I didn't use any source control services because it was only me working on it but don't plan on making that same mistake twice. If I get it solved this time around, I will be sure to update this post!
     
  8. Rodrigo_Ronin

    Rodrigo_Ronin

    Joined:
    Feb 4, 2016
    Posts:
    2
    I know this is a months old post, but I will leave a comment here, as I've struggled with that problem recently and was searching for some possible solutions and this thread at least helped me to understand one part of the problem.

    • The first thing that helped me was the wrong Aim Axis, as @Yandalf pointed, just changing to the correct axis fixed the "ground staring" problem.
    • The second problem is the character weird rotation while looking around. I've found that Animation Rigging was using the bones orientation as default and those were rotated at creation, so I need to account for those values in the offset section.

    The final result is not perfect, but almost what I wanted:

    bone_rotation.png parameters.png

    anim-rigging-test.gif
     
    Ninquiet likes this.
  9. ChrisP999

    ChrisP999

    Joined:
    Feb 15, 2022
    Posts:
    5
    This solved my problem too, I just added a gameobject to the model connected to my neck object and re-attached the head to my new game object instead, and set the constraint on this new 'object' inbetween the neck and head.