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 Josh707 · Jun 27, 2012 at 09:20 PM · c#animationblendersplit

Unity won't allow animations

At the start of my C# script I have defined all of these variables as animations

 public class Animations : MonoBehaviour {        
     //Fist Animations
     public Animation LeftPunch = null;
     public Animation RightPunch = null;
     public Animation Idle = null;
     public Animation RaiseFist = null;
     public Animation LowerFists = null;
     public string CurrentWeapon = null;
     private bool FistRaised = false;
 
     // Use this for initialization
     void Start () {
         LeftPunch.wrapMode = WrapMode.Once;
         RightPunch.wrapMode = WrapMode.Once;
         RaiseFist.wrapMode = WrapMode.ClampForever;
         FistRaised = false;
     }
     
     // Update is called once per frame
     void Update () {
         
         if(CurrentWeapon == "Fists"){
             if(FistRaised == false){
                 RaiseFist.Play();
                 FistRaised = true;
             }
         
             if(Input.GetMouseButtonDown(0)){
                 LeftPunch.Play();                
                 
             }
             if(Input.GetMouseButtonDown(1)){
              RightPunch.Play();    
             }
             
         }

When I attach this script to the player controller, or the arms model I made the animation with, I cannot drag the animations I made into their spots. It shows the circle with the slash through it.

alt text

^ Those spots. I used blender to make the animations, and I did the all-animations-in-one-file and split them according to frames. Why won't it let me use my animations? Ever since I started my project I've had nothing but error after error with animations, and once I actually get them to export it won't even load them.

What am I doing wrong?

Comment
Add comment · Show 2
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 DaveA · Jun 27, 2012 at 09:23 PM 0
Share

ex: public Animation LeftPunch = LeftPunch // what does this mean? Why are you assigning it to itself when it hasn't been defined yet? Get rid of = whatever and try again.

avatar image Josh707 · Jun 27, 2012 at 09:29 PM 0
Share

Sorry, they were all originally null and I wanted to try just putting the names.

1 Reply

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

Answer by Josh707 · Jun 28, 2012 at 04:55 AM

I found the answer. Since I split the clips from one animation in Unity they became AnimationClips, not Animations! So if I do

 public AnimationClip LeftPunch;

I can bring them in.

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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

My Blender object causes frame rate drops 1 Answer

How to go to starting point of an animation which is running already? 1 Answer

Distribute terrain in zones 3 Answers

Can't move parts and bones from a 3D model 2 Answers

how to play split animations from a blender 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