Search Unity

Animator animation movement limits

Discussion in 'Animation' started by Mangonels, Dec 6, 2021.

  1. Mangonels

    Mangonels

    Joined:
    May 8, 2018
    Posts:
    20
    Context:

    Hey. So we have some eyelashes, rigged with like 4 to 5 bones. (No idea why they have so many bones, I'm not the rigger). These bones are then animated in order to do a blink, all animations are imported as fbx's.

    However, within the animator state machine, there are multiple layers which produce blinks (or mere eyelash movements related to facial expressions. I believe this is achieved mainly through the rotation of such bones). We noticed that when the blinking layer is active together with certain animations which involve eyelash movements on the base layer, the rotations for the eyelashes get added to each other (consider the blink layer is marked as additive), resulting in the eyelashes going further beyond limits (overlaping with cheeks).

    Problem:

    In order to understand this addition phenomenon, I did a test on a new clean project, simply animating a rectangle from it's parent transform. This would act similar to how each eyelesh bone is being rotated:



    The rectangular piece is being rotated up to 180º (90º up, 90º down) on the base layer. But then there's an extra layer which rotates it 90º. (45º up, 45º down). When this last mentioned layer is active, the rotation goes beyond the 180º range, an extra 45º both up and down.

    In principle, I feel like a good way to limit this excessive movement would be to "clamp" or limit animation rotations inflicted by the various animation states within the animator. This way the eyelashes would never go beyond limits.

    For simplicity's sake, I'd like to know what I'd need to configure, or code, in order to limit the movement of the rectangle within a 180º rotation range. In essence, it should never go beyond that, no matter how many layers are adding degrees to the rotation through their animations.

    I probably should be able to extraploate the solution to the rectangular piece problem to whatever is going on with the eyelashes.

    Thanks in advance for any advice!
     
    Last edited: Dec 6, 2021
  2. Mangonels

    Mangonels

    Joined:
    May 8, 2018
    Posts:
    20
    Thinking I may approach with something similar to coding a script that checks rotations in LateUpdate() and clamps within thresholds.