Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed May 28, 2012 at 06:49 PM by KiraSensei for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by KiraSensei · May 08, 2012 at 02:37 PM · animationsmultipleinteractioncombine

How to combine animations ?

Hello everyone !

I'm new at unity, but I already love it and intend to develop several things on it !

After a lot of tutorials on the internet, answers found in this forum (thanks for this huge community by the way :) ), I found myself in front of a big problem without finding any solutions : combining animations.

I started a multiplayer FPS. My character has several animations (walk, idle, jump, knife shot, ...). My problem is I want the character to walk when the up arrow is pressed (no problem for that), arms to move for a knife shot when fire1 is pressed (no problem again), BUT, the combination of the two of them il a problem. I tried several solutions, but nothing worked as i wanted :(

The problem is that my walk animation is looking good when i hit with the knife, but the knife shot animation is like "limited", the arm moves not as high as it should go, not as high as it goes if the character is not walking in the mean while... There is also a little glitch on the walk animation while the knife animation is playing but i think this is the same problem. There is some knid of interaction between the 2 animations.

At first the walk animation moved shoulders and feet and the knife animation was moving only shoulders. Then I removed the shoulders animation in the walk to not have interferences but it changes nothing. I'm sure it's an obvious solution and i'm missing something huge but I can't figure it out myself. Any suggestions ? Thanks for advance :)

This is the code (with only important ligns):

 function Start () {
     animation["knife"].layer=1;
     animation["knife"].blendMode = AnimationBlendMode.Blend;
     animation["walk"].blendMode = AnimationBlendMode.Blend;
 }
 
 function Update() {
         if (Input.GetButtonDown("Fire1"))
         {
             Fire();
         }
         
         if (Input.GetKeyDown(KeyCode.UpArrow))
         {
             if (!animation.IsPlaying("walk"))
             {
                 animation.CrossFade("walk");
             }
         }
     }
     
 function Fire() {
     animation.CrossFade("knife");
 }
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
2
Best Answer

Answer by Paulius-Liekis · May 08, 2012 at 02:52 PM

Look into AddMixingTransform function - it allows you to play one animation on lowerbody and other on upperbody.

  • This is good example project: http://unity3d.com/support/resources/example-projects/3rdpersonshooter

  • "Unite 09 - Character Animation tips and tricks" video talk describes techniques used in the example project: http://unity3d.com/unite/archive/2009

Welcome to Unity Answers!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple animations problem. 0 Answers

Exporting multiple animations from Blender 2 Answers

how to make one script with different animations attached 2 Answers

Can i do multiples scenes ? 2 Answers

Multiple animations in the same FBXfile? 9 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges