• 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
Question by windrunner · Jun 23, 2013 at 11:24 PM · animationcharactercontrollermixamofloating

Character moving up when animated.

Hi there. I am new to the forum, t$$anonymous$$s is my first question here, started working with Unity sometime ago and I am doing my best at learning it, made some progress but found some dead ends.

I followed the tutorials to set up animations to my character and it worked pretty well, or so I thought.

My animations work when I press the said key, all animations are working, however, somet$$anonymous$$ng seen to be going wrong.

When I set up my character animated she goes some distance up, I don't really know how to explain it... I made a video just in case.

What happens is that, with animations, she goes up a bit, quite a bit; without animations she stay right in place, no unwanted translations.

It might have somet$$anonymous$$ng to do with the script I made... It was made just following Unity's site tutorial.

In case it is relevant, my animations are from Mixamo, the Unlimited Mixamo Store (default, not the Mecanim one) and all in .anim file. As they work, I am not sure if the animations are the problem, in the animation preview (w$$anonymous$$ch I forgot to record) the character is right on the ground.

I tried to set up a character controller, for what I know it was supposed to make my character $$anonymous$$t the ground and stop there, not working...

I also tried (not in the video) to set up RigidBody, but then the character falls like crazy, getting past the ground and going on forever...

Not sure what to look for anymore... Saw a lot of tutorials explaining many stuff, so far, not$$anonymous$$ng worked.

I was once able to set up the character to be controllabe using the T$$anonymous$$rdPersonController (From Lerpz's demo), I could control the character, however, she was still floating and now, for some reason, the controller doesn't work anymore, but that is another t$$anonymous$$ng.

I would really appreciate any tip here. Thanks for your time.

Here's the video showing what is happening: http://www.youtube.com/watch?v=UFSlFF-2dac&feature=youtu.be

OBS: Up (W), Down(S), Left(A), Right(D), Skill(Space), Run(S$$anonymous$$ft) are Axis I made to have better control over the commands.

T$$anonymous$$s is the script I made:

 function Start () {
    // Set all animations to loop
    animation.wrapMode = WrapMode.Loop;
    // except skill
    animation["Allie - Default@standing backflip - loop"].wrapMode = WrapMode.Once;
    
    
     // Put idle and walk into lower layers (The default layer is always 0)
    // T$$anonymous$$s will do two t$$anonymous$$ngs
    // - Since backflip and idle/walk are in different layers they will not affect
    //   each other's playback when calling CrossFade.
    // - Since backflip is in a $$anonymous$$gher layer, the animation will replace idle/walk
    //   animations when faded in.
    animation["Allie - Default@standing backflip - loop"].layer = 1;
    
     
    // Stop animations that are already playing
    //(In case user forgot to disable play automatically)
    animation.Stop();
 }
    
    function Update () {
    // Based on the key pressed,
    // play the walk animation 
   
        //T$$anonymous$$s handles the forward animation
         if (Input.GetAxisRaw ("Up"))
             animation.CrossFade ("Allie - Default@female walk - loop");       
              
        //T$$anonymous$$s handles the backward animation      
         if (Input.GetAxisRaw ("Down"))
             animation.CrossFade ("Allie - Default@female walk backwards - loop");  
                 
        //T$$anonymous$$s handles the left animation        
         if (Input.GetAxisRaw ("Left"))
             animation.CrossFade ("Allie - Default@walking strafe to the left - loop");
  
        //T$$anonymous$$s handles the right animation               
         if (Input.GetAxisRaw ("Right"))
             animation.CrossFade ("Allie - Default@walking strafe to the right - loop");   
      
                 
  //T$$anonymous$$s handles the skill animation, note that the skill animation is actually a jump      
         if (Input.GetAxisRaw ("Skill"))
             animation.CrossFade ("Allie - Default@standing backflip - loop");  
             
                                       
  // Here we make sure that the run animation play if we hold down s$$anonymous$$ft either with an animation already playing or not
    
    
           if(((Input.GetAxisRaw ("Run")) && (Input.GetAxisRaw ("Up")))  || (Input.GetAxisRaw ("Up")) &&   (Input.GetAxisRaw (("Run"))))             
            
                 animation.CrossFade ("Allie - Default@female run forward - loop");      
                 
           if(((Input.GetAxisRaw ("Run")) && (Input.GetAxisRaw ("Down")))  || (Input.GetAxisRaw ("Down")) &&   (Input.GetAxisRaw (("Run"))))             
            
                 animation.CrossFade ("Allie - Default@female run backward - loop"); 
                 
           if(((Input.GetAxisRaw ("Run")) && (Input.GetAxisRaw ("Left")))  || (Input.GetAxisRaw ("Left")) &&   (Input.GetAxisRaw (("Run"))))             
            
                 animation.CrossFade ("Allie - Default@running strafe to the left - loop"); 
                 
           if(((Input.GetAxisRaw ("Run")) && (Input.GetAxisRaw ("Right")))  || (Input.GetAxisRaw ("Right")) &&   (Input.GetAxisRaw (("Run"))))             
            
                 animation.CrossFade ("Allie - Default@running strafe to the right - loop"); 
                   
                                                                                                         
  //Now we handle the aim idle animation
  
          if(Input.GetAxisRaw ("Aim"))
            animation.CrossFade ("Allie - Default@rifle standing aiming idle - loop");  
                                                                                     
  //We can walk w$$anonymous$$le the aim animation is on, so we must check if we are aiming and wanting to walk
  
           if(((Input.GetAxisRaw ("Aim")) && (Input.GetAxisRaw ("Up")))  || (Input.GetAxisRaw ("Up")) &&   (Input.GetAxisRaw (("Aim"))))             
            
                 animation.CrossFade ("Allie - Default@walking w$$anonymous$$le aiming rifle - loop");      
                 
           if(((Input.GetAxisRaw ("Aim")) && (Input.GetAxisRaw ("Down")))  || (Input.GetAxisRaw ("Down")) &&   (Input.GetAxisRaw (("Aim"))))             
            
                 animation.CrossFade ("Allie - Default@walking backwards w$$anonymous$$le aiming rifle - loop"); 
                 
           if(((Input.GetAxisRaw ("Aim")) && (Input.GetAxisRaw ("Left")))  || (Input.GetAxisRaw ("Left")) &&   (Input.GetAxisRaw (("Aim"))))             
            
                 animation.CrossFade ("Allie - Default@rifle walk strafe left - loop"); 
                 
           if(((Input.GetAxisRaw ("Aim")) && (Input.GetAxisRaw ("Right")))  || (Input.GetAxisRaw ("Right")) &&   (Input.GetAxisRaw (("Aim"))))             
            
                 animation.CrossFade ("Allie - Default@rifle walk strafe right - loop");     
                 
  //We must check if we will fire w$$anonymous$$le aiming
  
           if(((Input.GetAxisRaw ("Aim")) && (Input.GetAxisRaw ("Fire")))  || (Input.GetAxisRaw ("Fire")) &&   (Input.GetAxisRaw (("Aim"))))             
            
                 animation.CrossFade ("Allie - Default@firing a rifle w$$anonymous$$le standing - loop"); 
  
  //Do we want to fire w$$anonymous$$le aiming and walking?  
  
               if(((Input.GetAxisRaw ("Aim")) && (Input.GetAxisRaw ("Up")) && (Input.GetAxisRaw ("Fire"))) || (Input.GetAxisRaw ("Up")) &&   (Input.GetAxisRaw (("Aim")) && (Input.GetAxisRaw ("Fire"))))            
            
                 animation.CrossFade ("Allie - Default@firing a rifle w$$anonymous$$le standing - loop");      
                 
           if(((Input.GetAxisRaw ("Aim")) && (Input.GetAxisRaw ("Down")) && (Input.GetAxisRaw ("Fire"))) || (Input.GetAxisRaw ("Down")) &&   (Input.GetAxisRaw (("Aim")) && (Input.GetAxisRaw ("Fire"))))             
            
                 animation.CrossFade ("Allie - Default@firing a rifle w$$anonymous$$le standing - loop"); 
                 
           if(((Input.GetAxisRaw ("Aim")) && (Input.GetAxisRaw ("Left")) && (Input.GetAxisRaw ("Fire"))) || (Input.GetAxisRaw ("Left")) &&   (Input.GetAxisRaw (("Aim")) && (Input.GetAxisRaw ("Fire"))))              
            
                 animation.CrossFade ("Allie - Default@firing a rifle w$$anonymous$$le standing - loop"); 
                 
           if(((Input.GetAxisRaw ("Aim")) && (Input.GetAxisRaw ("Right")) &&  (Input.GetAxisRaw ("Fire"))) || (Input.GetAxisRaw ("Right")) &&   (Input.GetAxisRaw (("Aim")) && (Input.GetAxisRaw ("Fire"))))             
            
                 animation.CrossFade ("Allie - Default@firing a rifle w$$anonymous$$le standing - loop");                                                      
                                           
                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
  //If not$$anonymous$$ng is being pressed play the idle animation                                     
   if(Input.anyKey == false)
     animation.CrossFade ("Allie - Default@standing idle"); 
     
        
           
               
 }
Comment
StarBlazer
IlluBlack

People who like this

2 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 pickle chips · Jun 24, 2013 at 04:42 AM 0
Share

I had a similar issue, but it had to do with the model. Since you didn't make the model yourself, I can't think of many options. My issue was just that in the program I used to make it (blender) I didn't apply the location/rotation/scale, so I just went back and did that.

Maybe message the creator and ask them?

avatar image windrunner · Jun 24, 2013 at 05:04 AM 0
Share

I believe I found out what happened. Had to do with the pivot being in the center o the character and not the feet, so it was centering to the pivot position in scene... Or so I think.

I imported it back into 3DS Max and gave it some work, it is in place now but animations aren't playing propperly. I am still to find out how to solve everything, but I think at least I have a start point now.

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Otaku_Riisu · Jun 03, 2016 at 06:15 AM

You have to disable motion on the Y Axis.



You can do t$$anonymous$$s simply by checking "BAKE IN TO POSE", for Y, in the animation import settings.



alt text



T$$anonymous$$s should solve your problem.



Note that generally you leave the "based upon" value simply as "original". (W$$anonymous$$chever of the three settings you choose for "based upon", it does not either way affect the "floating upwards" problem described here in t$$anonymous$$s question.)



Note that of course you can not turn off root motion. The actual walking/turning motion (so, on x and z) is the root motion!


screenshot-4.png (154.2 kB)
Comment
ishdagz
$$anonymous$$
Fattie
xainulabdeen
Berserker44
cperko1
Schlissel
IlluBlack
DSivtsov
TonyV125
Brother_77
enes-ozdemir
jytreus

People who like this

13 Show 3 · 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 Tanoshimi2000 · Feb 09, 2019 at 02:33 PM 0
Share

Was wondering if you had any idea why this is not available in 2017. I have imported a bunch of fbx animations from Mixamo, and they are all too high, but I don't have the Root Transformations items.

avatar image mrPRAZ Tanoshimi2000 · Apr 06, 2019 at 06:45 PM 0
Share

Is your rig marked as 'Humanoid'? If not the options such as Root Transformation items won't be available (for example if your rig is marked as 'Generic' which I believe is the default import option).

avatar image NordicMothCEO · Sep 03, 2021 at 10:15 AM 0
Share

Is there a solution to this with a Generic rig?

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

22 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

Related Questions

Player Animation and control panel 2 Answers

Third Person Controller 1 Answer

independent arm from body - unity2d 0 Answers

Character controller movement 1 Answer

accessing charactercontroller 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