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 GMagnus · Apr 24, 2013 at 12:29 PM · animationfbxweapon

Problems with animated entity

The problem is quite simple. I have an FBX model of a gun, with animations. To be more specific, the model (named WEAPON1), has two child parts. The body (called Arm), and the cannon (Called AXIS_CANNON, which is the animated part). To import the animations, I do the following:

  • First, I import the FBX into the project explorer by dragging it inside.

  • I select the imported model, and in the inspector, I create 4 animations, like this:

http://i.imgur.com/4A66TyH.jpg

  • Now, I drag the weapon model inside the scene.

  • I create a new C# script, called "WeaponController.cs". Adding the following lines:

       private int power;
         // Use this for initialization
         void Start () {
         power = 0;
             animation.Play("FIRING");
         }
    
    
    

I attach it to my WEAPON1 entity. Then, I add the animations trough the inspector, like this:

http://i.imgur.com/F7pO1DH.jpg

I start the game, but nothing happens. No animation plays. I tried a lot of things like, for example, getting the object:

 GetComponent("WEAPON1").animation.Play("FIRING");

Or passing the WEAPON1 entity trough the inspector:

     public GameObject Weapon;
     private int power;
     // Use this for initialization
     void Start () {
     power = 0;
         Weapon.animation.Play("FIRING");
     }

With no luck. So my last chance is that you point me what am I doing wrong...

The only clue is that the console give me a few warnings telling me that I should mark my animations as 'Legacy', but I have no clue on how to do that.

Thanks in advace!

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

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by TonyLi · Apr 24, 2013 at 01:20 PM

Select WEAPON1 and go to the Inspector's Rig tab. In the drop-down, select Legacy, then click Apply.

Then go to the Animations tab and make sure all of your animations look okay.

You should notice that your game object will no longer have an Animator component. It should only have an Animation component. (Right now, it has both.)

At this point, it should work.

If it doesn't, then, as a test, drag the FIRING animation into the Animation field at the top of the Animation component. Disable your WeaponController.cs script (uncheck the checkbox in Inspector). Try running again. Since Play Automatically is checked, it should start playing the FIRING animation immediately. If you didn't select Loop in the Animation import, it will only play once. Once you've confirmed that this is working (without any scripts that you've written), you can go back to your script and get that working, too.

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 GMagnus · Apr 24, 2013 at 01:30 PM 0
Share

Yeh, seems like setting my animations as Legacy was my problem. Your answer helped me and the problem is solved. $$anonymous$$any 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

12 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

Related Questions

How do I prevent Unity overshooting graph curves? 0 Answers

Child problem in animation 1 Answer

Blender FBX repeated animations 1 Answer

FBX file animation problem 0 Answers

Help with textures 0 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