Search Unity

How to use the controls over a downloaded animated character asset

Discussion in 'Getting Started' started by Blackfly972, Jan 20, 2019.

  1. Blackfly972

    Blackfly972

    Joined:
    Jan 20, 2019
    Posts:
    8
    Hello Guys I'm very new to Unity with a little bit of programming experience. So, I've downloaded this asset package https://assetstore.unity.com/packages/3d/characters/humanoids/sci-fi-hero-handpainted-demo-106154 I've figured how to import it into the scene and everything but now I want to use its animations with different controls. meaning standing still: having the standing animation going, use the 'awsd' buttons: having the walking animation going + actually moving the character and so on and so forth.
    Can someone help me with that please? I did a little bit of research where I've seen that I need to use the character controller component but I'm a bit lost. ^^
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    You'll need to write some code to watch the inputs (from keyboard/mouse/gamepad) and set appropriate flags on your AnimatorController. Those flags will be set to trigger state transitions (and thus different animations).

    All this is going to be rather hard to figure out in isolation. You should spend a week or two going through the Unity tutorials, especially those having to do with input, coding, and animation.
     
  3. Blackfly972

    Blackfly972

    Joined:
    Jan 20, 2019
    Posts:
    8
    Thank you very much for your response! :D I'm actually watching the tutorials you recommended to me and I'm starting to get a better understanding on what I need to do. can I get back to you if need help? you seem like you really know your way around unity haha.
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Post here when you get stuck, and I'm sure somebody will help you! :)
     
  5. Blackfly972

    Blackfly972

    Joined:
    Jan 20, 2019
    Posts:
    8
    Hey guys, so I finally managed to write a c# script to my character in order to make it move. However, I'm now struggling with the camera because I want it to have a first person view but I don't know how to setup a proper camera for that purpose. I tried to attach a new camera to the character but that does not work. can you guys help me with that? do I need to create a new script for that? or is there an easier way to make it work? thanks in advance for your help guys ^^
     
  6. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    You don't need a script for that, nor do you need a new camera. Just grab the existing camera, and drag it inside your player hierarchy where you want it to be (inside the Head, for example).
     
  7. Blackfly972

    Blackfly972

    Joined:
    Jan 20, 2019
    Posts:
    8
    Hey guys! first of all thanks for all the help I've received through my learning that's awesome. I now have a new question which is still related to the camera that I've placed in the head of the character where I wanted it to be like JoeStrout suggested. However , because my game is a first person shooter I wanted to move the head of the character with the mouse. Its working but when I move the mouse up and down the weapon does not follow it. Also, when I move down the view goes through the character all the way down. Do you guys have any idea how can I fix this? Again, thanks in advance for your help.
     
  8. Green11001

    Green11001

    Joined:
    Apr 14, 2018
    Posts:
    397
    Do you have any images that show what is going on?
     
  9. Blackfly972

    Blackfly972

    Joined:
    Jan 20, 2019
    Posts:
    8
    Thanks for your response!! Yes I do have some screenshots! when I move the camera which is in my head this is what happen. Screen Shot 2019-03-10 at 2.28.33 PM.png Screen Shot 2019-03-10 at 2.29.39 PM.png
    Screen Shot 2019-03-10 at 2.30.16 PM.png
     
  10. Blackfly972

    Blackfly972

    Joined:
    Jan 20, 2019
    Posts:
    8
    hey sorry to insist ^^ I don't know if you've received my response. I posted some screenshots
     
  11. Green11001

    Green11001

    Joined:
    Apr 14, 2018
    Posts:
    397
    i cant really tell whats going on so i dont think i can help
     
  12. Blackfly972

    Blackfly972

    Joined:
    Jan 20, 2019
    Posts:
    8
    oh ok thanks for your help anyways ^^ it's just that the camera in the head is moving too freely on the y-axis and the gun which is in the arms does not follow the camera when it goes up and down maybe I should have not put the camera in the head? I don't know... but I'll figure it out ^^ thanks
     
  13. Green11001

    Green11001

    Joined:
    Apr 14, 2018
    Posts:
    397
    Can you explain whats wrong and what you want to achieve in a simpler way?
     
  14. Green11001

    Green11001

    Joined:
    Apr 14, 2018
    Posts:
    397
    mvoing too freely on the y axis? your pivots could be wrong
     
  15. Green11001

    Green11001

    Joined:
    Apr 14, 2018
    Posts:
    397
    i think you can get the rotation of the head and then change the rotation of the arm based on that rotation
     
  16. Blackfly972

    Blackfly972

    Joined:
    Jan 20, 2019
    Posts:
    8
    Yes I think you're right I'm going to try to do that and I'll get back to you ^^ thank you very much for your help! really appreciate it!
     
  17. Green11001

    Green11001

    Joined:
    Apr 14, 2018
    Posts:
    397