Search Unity

Question Reusing animator controller with Avatar Mask

Discussion in 'Animation' started by Sneirox, Feb 28, 2021.

  1. Sneirox

    Sneirox

    Joined:
    Jun 25, 2013
    Posts:
    18
    Ok. For reusing animator controller for animations, I need to use AnimatorOverrideController. But what about avatar masks???
    I want to use the same animator controller, but change Avatar Masks in run-time and use it in different objects.
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    That's just one of the many things you can't do if you use Animator Controllers.
     
  3. Sneirox

    Sneirox

    Joined:
    Jun 25, 2013
    Posts:
    18
    Any way to do it without Animator Controllers?
     
  4. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Animancer (link in my signature) lets you avoid Animator Controllers and control everything in scripts at runtime so you could easily use the same set of animations with different masks on each character or whatever other organisational structure you can come up with in your scripts.
     
  5. Sneirox

    Sneirox

    Joined:
    Jun 25, 2013
    Posts:
    18
    How can I do it with Animancer Lite?
     
  6. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    Layers (and therefore layer masks) are pro-only so Animancer Lite will only let you try them out in the Unity Editor but you'll need to buy Animancer Pro to use them in runtime builds.
     
  7. Sneirox

    Sneirox

    Joined:
    Jun 25, 2013
    Posts:
    18
    Ok. Let me try it out first. How can I solve my problem with this plugin lite ?
     
  8. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    I recommend going through all the Examples (or at least the basics), but the Layers example demonstrates how to use layer masks.

    Your original problem isn't relevant with Animancer. Everything is set up at runtime so there is no need for any sort of override, you can just give each character their own mask.
     
  9. Sneirox

    Sneirox

    Joined:
    Jun 25, 2013
    Posts:
    18
    How can I give each character their own mask?
     
  10. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    If your script has a serialized AvatarMask field like in the Layers example then you can assign the mask you want in the Inspector so you can just give each character a different mask.