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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Weapon Animations HELP!!!

Discussion in 'Animation' started by Hasanaj, Jul 3, 2015.

  1. Hasanaj

    Hasanaj

    Joined:
    Jun 22, 2015
    Posts:
    21
    Hello guys. I have been looking for days on how to do this but i cant find any solution. So the problem is : I have a rigged character, and i want to make some animations for different weapons. I do this in blender. I have a couple of questions:
    1) Should i animate the character together with the guns or only the arms and then attach guns as child?
    2)If i animate the character together with hands, then i have to do different animations for each gun. Should I do this inside a single blender file or not?
    3) How would i go to change the guns(I know the script part but i mean the animations)?

    If anybody could explain it to me the guide on how to do this, I WOULD BE SOOO THANKFUL!!!
    Thanks in advance :)
     
  2. Hasanaj

    Hasanaj

    Joined:
    Jun 22, 2015
    Posts:
    21
    Anybody help me please
     
  3. kk99

    kk99

    Joined:
    Nov 5, 2013
    Posts:
    81
    Hello

    I am kinda doing something similar

    1)
    I assume the gun does not effect any bone/skin/skeleton of your character (if it does, it's not a humanoid and you will get a lot of trouble later), so you can only put the gun as a child of your hand.

    2)
    That's why you use a child, and you have the same animation for different guns, if they should behave the same way. A .45 Magnum should have a different impact than a small pistol but thats a different story :)

    3)
    Not sure what you mean by that? I used the Asset Standard ThirdPersonController and then added animation into it.
    You could activate a shooting animation by changing a bool val (in my case action) which connects the grounded with the action (see my screenshot)

    When the animation is finished you have to reset it.

    The following code shows the reset statement.
    void Update(){

    if ( m_Animator.GetCurrentAnimatorStateInfo(0).IsName("Action"))
    {
    Debug.Log("T Action Action Action " );
    m_Action = false;
    }
    }

    This works perfectly inside the ThirdPersonCharacter.cs
     

    Attached Files:

  4. Hasanaj

    Hasanaj

    Joined:
    Jun 22, 2015
    Posts:
    21
    Thank you very much for your help. One question : So i have to animate only the hands and then put different guns on hands(child). And I have to animate both, single handed and dual handed guns right?
     
  5. kk99

    kk99

    Joined:
    Nov 5, 2013
    Posts:
    81
    Only hands is enough but you have to use the entire skin to animate.

    If you cut 90% of the bones because they are technically not needed in this particular shooting animation later in unity it will screw everything.

    Yes, you need two different animation for single and dual handed gun.


    My last advice is to use the prefab Ethan.fbx as model for animation. If the finished animation looks good on it, you can easily replace with another one.
     
  6. Hasanaj

    Hasanaj

    Joined:
    Jun 22, 2015
    Posts:
    21
    Ok, i apriciate it
     
  7. Hasanaj

    Hasanaj

    Joined:
    Jun 22, 2015
    Posts:
    21
    If you want, since you are working in FPS too, i could suggest a page for free gun animations and more.
    www.mixamo.com
     
  8. kk99

    kk99

    Joined:
    Nov 5, 2013
    Posts:
    81
    You are welcome. :)

    mixamo, I've heard of
    I can recommend www.daz3d.com
    Seems to be basically the same