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
1
Question by Emericanized · Dec 07, 2011 at 07:35 PM · animationcharacterblendingadditive

Blended Animation offsetting

Hi community,

We are currently struggling with some ugly rotational offsetting on our character animations. This is happening when we play a run/idle loop, and then layer the fire(or any upperbody) animation on top. We are only blending the animation from the top spine bone upwards. It almost seems to be adding the rotation of the lower animation onto the rotation of the fire animation.

We can't seem to get over this hurdle, so I figured I'd try here! I did some searching on the site, but am not seeing anything specifically related to popping/offset animations when blending.

Any help is much appreciated, even if you can paste a hyperlink to a related solution!

Here is a the test script we use on the art side to check out our animations. There is some extra gui stuff in there, but the actual blending is being handled the same way:

 public class AnimationTesting : MonoBehaviour {
     
     public AnimationClip[] animClips;
     public Transform mCharacterSpine;
     
     private int animationPosition;
     private int animationBlendPosition;
     private bool canLoop;
     private bool canBlend;
 
     
     // Use this for initialization
     void Start () {
         for(int i = 0; i < animClips.Length; i++){
             animation.AddClip(animClips[i], animClips[i].name);
         }
     }
     
     // Update is called once per frame
     void Update () {
     
     }
     
     void OnGUI(){
         
         if(GUI.Button(new Rect(100,100,120,30), "Play")){
             if(canBlend){
                 DoAnimationBlend(animClips[animationPosition].name, animClips[animationBlendPosition].name);
             }
             else{
                 animation.Play(animClips[animationPosition].name);
             }
         }
         if(GUI.Button(new Rect(100,140,120,30), "Stop")){
             animation.Stop();
         }
         if(GUI.Button(new Rect(100,180,120,30), animation[animClips[animationPosition].name].wrapMode.ToString())){
             if(canLoop){
                 animation[animClips[animationPosition].name].wrapMode = WrapMode.Loop;
                 canLoop = false;
             }
             else{
                 animation[animClips[animationPosition].name].wrapMode = WrapMode.Once;
                 canLoop = true;
             }
         }
         if(GUI.Button(new Rect(100,220,120,30), "Switch Animation")){
             if(animationPosition == animClips.Length -1){
                 animationPosition = 0;
                 return;
             }
             animationPosition++;
         }
         
         GUI.Label(new Rect(80,50,220,30), "Current Animation : " + animClips[animationPosition].name);
         
         
         if(GUI.Button(new Rect(400,100,120,30), "Blend")){
             canBlend = !canBlend;
         }
         
         if(canBlend){
             GUI.Label(new Rect(370,50,350,30), "Blend Above Spine Animation : " + animClips[animationBlendPosition].name);
             if(GUI.Button(new Rect(400,140,150,30), "Switch Blend Animation")){
                 if(animationBlendPosition == animClips.Length -1){
                     animationBlendPosition = 0;
                     return;
                 }
                 animationBlendPosition++;
             }
             
             
         }
 
     }
     
     
     private void DoAnimationBlend(string baseAnim, string blendAnim){
         
         animation[blendAnim].blendMode = AnimationBlendMode.Blend;
         animation[blendAnim].AddMixingTransform(mCharacterSpine);
         
         animation[blendAnim].layer = 2;
         
         animation.SyncLayer(1);
         
         animation.Play(baseAnim);
         animation.Play(blendAnim);
         
     }
 }


EDIT: I should add that the upper body animations seem to look ok on an idle loop (where there is very little animation on the spine). Its when the body starts turning in sneaks or runs that the problem gets out of control.

If the animation on top spine is being totally overwritten, should it matter what is going on in the spine?(sorry if that's a dumb question, trying to wrap my head around it)

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 Emericanized · Dec 08, 2011 at 02:17 PM 0
Share

Ok, an update:

The animator was applying hip rotation to the com/root of the biped for the run, and the animations being stacked on top looked to be inheriting that transform.

We wiped those keys, and are trying to match the upper body pose of the run to the upper body pose of the fire animation to see if that fixes it.

It looks like we will need a separate set of upper body animations for when the character is crouching, as they all point down into the ground. Either that or we modify the crouch idle/runs to have a straight back... Any experiences with this situation out there?

avatar image Maria Chernykh · Jun 21, 2013 at 05:10 AM 0
Share

I understand that this is an old thread, but maybe some solutions have been found? Have the same problem...

0 Replies

· Add your reply
  • Sort: 

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Issue with animation 1 Answer

additive animation wont stop playing 0 Answers

Reference clip for Additive blending animation in Mecanim 0 Answers

Additive Animation 0 Answers

How do I author animation clips for additive blending when the desired motion is returning to zero? 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