Search Unity

Question Best way to have upper body and lower body animation layers with different hip rotation

Discussion in 'Animation' started by Stephanommg, Dec 8, 2022.

  1. Stephanommg

    Stephanommg

    Joined:
    Aug 18, 2014
    Posts:
    88
    I have some spellcasting animations with the character idle, and I am implementing a feature that allows the character to move while casting.
    The approach is to play the casting animation in a layer (for upper body) and the walk animation in another layer (for lower body, including the hips).

    However, the hip rotation of the casting animations is sometimes significantly different from the hip rotation of the walk animation, making the character to have the upper body turned to the wrong side.

    I will place here the solutions I imagined, but none are much satisfactory (or feasible) to me:

    1) Get the rotation difference from the hips of the walk animation and the casting animation at runtime. Then, rotate the waist bone to compensate. This requires access to the rotation information of the hip in the animation itself but I couldn't find any way to get this. This is my preferred solution.

    2) Rotate some bone (waist or chest) to face the forward of the character. Problem: this still may lead to wrong upper body rotation since these bones are not necessarily facing the forward in the casting animation

    3) Manually rotate the waist for all casting animation to find the fixing rotation for each one, and apply them at runtime. Problem: too much work.

    4) Change all casting animations to have the waist bone correctly aligned to the hip of the walk animation. Problems: a) too much work; b) the casting animations may be played without walking so they would be misaligned in such cases (or I would need to have the unmodified version of them too, which is redundant)

    5) Make the lower body layer to exclude the hips. Problem: the legs will be wrongly rotated and it will look weird.