Search Unity

Getting a bone to ignore an animation from an animator.

Discussion in 'Scripting' started by dann96, Oct 7, 2015.

  1. dann96

    dann96

    Joined:
    Dec 6, 2014
    Posts:
    113
    I've been trying to find a way to get a bone on one of my models to ignore an animation and move based on a Vector3.Lerp method I'm using. How do I do this?
     
  2. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    You can use Mecanim layer avatar masks to disable layer control over certain bones, but as it is not designed for your particular use case, I am unsure if this would help in disabling Mecanim control over the bone entirely.

    If not, or if your animation is not avatar based, I would just override the bone transformation from script in LateUpdate.
     
  3. dann96

    dann96

    Joined:
    Dec 6, 2014
    Posts:
    113
    How exactly would I go about overriding the bone? Every time I try to translate it in LateUpdate, It gets pulled back every frame.
     
  4. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    This might be a case where the quickest and dirtiest solution is the right one: if you rename the bone, the animator won't be able to find it.
     
  5. dann96

    dann96

    Joined:
    Dec 6, 2014
    Posts:
    113
    I feel like the biggest idiot right now. Thanks, though. It worked.
     
  6. benaiahstone

    benaiahstone

    Joined:
    Oct 15, 2015
    Posts:
    1
    thanks guys so much ive been bangin my head on this all week your lifsavers want ed it for a ragdoll combat game that a looter type game but its also my first game so dont be making kingdomsan all that
     

    Attached Files:

    • d&d.PNG
      d&d.PNG
      File size:
      41 KB
      Views:
      690
  7. thiernotechnologies

    thiernotechnologies

    Joined:
    Dec 17, 2022
    Posts:
    1