Search Unity

Question How to tilt the entire upperbody up or down, whilst facing a direction?

Discussion in 'Animation' started by TragicallyCanadian, Sep 18, 2023.

  1. TragicallyCanadian


    Mar 26, 2020
    Hello there.

    Desired Functionality

    I essentially want to make the characters upper body face the direction of its attack by how much you are looking up or down. Basically, if you look up and swing you swing towards the air above you, if you look down you swing towards the air below you.

    Like this
    Now this works, but not for EVERY animation. I have problems for some of my attack animations.

    This one does not work
    As you can see the first attack is played without looking up or down, and it thrusts forward as intended, however when I look up the thrust is diverted to the side and does not stay centered.

    I think this is happening because with some of my attack animations the spine isn't always facing forward towards its target, so when rotating the spine to face up or down the animation can be offset to face the incorrect direction. My question is, how would I go about achieving the desired result? Currently I am doing this with some simple code. Here is a quick snippet.


    Attached Files: