Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Help with moving specific body parts (Many details provided w/pictures)

Discussion in 'Animation' started by Maxske, Feb 18, 2016.

  1. Maxske

    Maxske

    Joined:
    Feb 20, 2015
    Posts:
    37
    I am making animations for a survival game and some of those animations include walking running swimming etc. I have animations for punching and swinging axes and I want those animations to punch/swing up when I am looking up. Currently if i am looking upwards, the animation still only punches/swings forward like the standard way it was made. Same thing for looking downward, if i look down it still swings forward.

    I am using the FPS controller and I put an idle animation over it and hid the FPS white blob. That idle animation I am using as 10 different animations attached to it. When i decided to swing or punch or run, I use a script to play the animation. That being said, how may I go about making it so that if I look up or down, my upper torso and stuff follows and bends to where I am looking?

    I will show a picture of how it looks when I punch and how my FPS animation toolbar looks.
    1 image is my animation section
    2 image is how punching looks
    3 image is how you cant see punch when looking up!

    Thanks for the help!

    f26d61b06091bd7afbd016d6d938aa98.jpg Untitled-1.jpg 2.jpg
     
  2. mathiasj

    mathiasj

    Joined:
    Nov 3, 2015
    Posts:
    64
    Why don't you just rotate the model with the camera so that the hands are always in front of the camera?
     
  3. Maxske

    Maxske

    Joined:
    Feb 20, 2015
    Posts:
    37
    I tried attaching the model to the camera so it does that. When that happens, it strangely stretches and distorts. But not only that, it makes the character basically go 90degrees into the air when looking straight up
     
  4. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,032
    If you don't care how it look, because the model is not seen all you need to do is rotate the upper spine bone to look in the direction of the camera forward.
    You should do it in LateUpdate after mecanim did its thing.

    If you want a more realistic bend because the model will be seen maybe from some mirror image, then you need to create an animation bending the torso with some modeling package and play the animation manually as an overlay or additive layer, but it gets a lot more complex.