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 /
avatar image
0
Question by Edyvargas · Dec 04, 2014 at 03:01 AM · animationmodelfbxanimator controllermask

How to Play 2 Animations from the same Model at the same time?

Hi, i have imported a model of a flying ship with 2 (actually 3) animations, one to move the propellers and the other two to turn right or left the alerons, the animations are like this on the imported model:

Running propellers = frame 0 to frame 10

Turn left the alerons = frame 10 to frame 20 (turn and back to initial position)

Turn right the alerons = frame 20 to frame 30 (turn and back to initial position)

So, the model its imported OK into Unity with the 3 animations set, but i dont know how to play the running propellers animation and AT the same time play one of the other 2 animations for turning right or left while the propellers are still runnig.

The problem is that when the turn animation occurs, the propellers are still (between the frames 10 to 30 of the FBX model), i know there is a way to mask a specific part of a single model, but im not sure how to do it, anybody have a clue?, Thank You!

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

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by M-G-Production · Dec 04, 2014 at 04:35 AM

Hi Edyvargas!

First:

I really think you should create individuals animations for what you are trying to do here. When this will be done, set your Running propellers animation to Clampforever mode (wrapMode). So when it will be played, it will loop the last frame "forever" until you say anything else.

Then, with 2 individuals animations for each alerons (going right and going left) I really think you do more specifics things!

Oh and read about this: http://docs.unity3d.com/ScriptReference/Animation-wrapMode.html

Bests Math

Comment
Add comment · Show 2 · 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
avatar image Edyvargas · Dec 04, 2014 at 07:08 AM 0
Share

Hi $$anonymous$$ath, Thank you for your answer,

Yes its more specific really, but i simplify it trying to make a simplier question, there is an animation for the alerons move to the right, other for the alerons back to the center for each one, other animations for the tail turn aleron and for the front tire and others, this doesnt involve the entire object movment, only the parts movement.

Ill check the things you answer now, thank you!

...for individual animations you mean each part of the model object animated into unity?, right now the model its separated into layers and each layer that has bones, has its own animation, but everything its animated in the same timeline of the imported model, separeted into Unity like this http://docs.unity3d.com/$$anonymous$$anual/Splittinganimations.html.

avatar image Edyvargas · Dec 04, 2014 at 07:49 AM 0
Share

....Ops, i understand now, you mean dont use Animator Controller, and just set up animations with the Rig options of the model set to Legacy, and then add each animation to an Animation Component added to the model on the project....i do that, now im wondering how to play both animations on script cause the old way animation.play seems its not working on Unity 4.6 anymore...

avatar image
0

Answer by zharik86 · Dec 04, 2014 at 08:49 AM

If your models have legasy animation and some bones, you can use layers and mixing animation. Example see below (write on CSharp):

  //For example, your model have tree bones by names MainBone->CenterBone->Propeller
  //Animation propellers only for bone "Propeller", animation is Loop
  //Animation turns for bone "MainBone", animation is Once

  void Start() {
   //Find animation propellers and set layers more than other animation. Default is 0
   this.animation["myAnimProp"].layer = 2
   //Find bone for propeller and add mix. That play animation for propeller is only bone "Propeller"
   this.animation["myAnimProp"].AddMixingTransform(this.transform.Find("MainBone/CenterBone/Propeller"));
  }

  void Update() {
   //Play animation propellets
   this.animation.CrossFade("MyAnimProp");
   //Play animation turn of key down
   if (Input.GetKeyDown(KeyCode.L)) {
    this.animation.Play("MyAnimTurnLeft");
   }
  }

Attach this script at your model on Scene. I hope that it will help you.

Comment
Add comment · Show 1 · 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
avatar image Edyvargas · Dec 04, 2014 at 09:12 AM 0
Share

Hi zharik86,

Thank you for you reply and code to achieve the both animations working with Legacy animation, i back my model to default animation mode cause found how to achieve the both animations working with layers as you say but throught the animation controller, but if i need to use legacy again ill check throught that way, Thanks!

avatar image
0

Answer by aero80 · Dec 04, 2014 at 01:19 PM

Sounds like an animation layer issue. There should be a video about mechanim on learn section or unite where they show a character wave his hand while running at the same time. You should check that out.

Comment
Add comment · Show 1 · 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
avatar image Edyvargas · Dec 05, 2014 at 10:29 PM 0
Share

Yes, its working with animator controller layers now, thanks.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

26 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Rendering FBX with multiple animations 1 Answer

Broken animation in URP project. 2 Answers

3ds Max animation import 1 Answer

Blender FBX import model with animation issues 0 Answers

Scale animation with model 1 Answer


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