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 TinyUtopia · Mar 15, 2011 at 12:11 AM · animationblendingadditive

additive animation wont stop playing

I've created an animation player that uses a secondary animation which resides on top level layer and plays using AnimationBlendMode.Additive. It's blending fine, but the problem that I'm having is that it won't stop playing. Regardless of if I put the wrapMode as Once or Clampforever, it still forces the lower level animation to continue to loop.

private var leanLeft : AnimationState;

function Start(){ leanLeft = animTarget.animation["A1LFoot"]; leanLeft.layer = 10; leanLeft.blendMode = AnimationBlendMode.Additive; leanLeft.wrapMode = WrapMode.ClampForever; leanLeft.weight = 1.0; leanLeft.enabled = false; // This makes sure the additive animation is turned off normally }

 function Update()
 {

          var hit : RaycastHit;
             //ray shooting out of the camera from where the mouse is
             var ray : Ray = Camera.main.ScreenPointToRay(Input.mousePosition);

             if (Physics.Raycast(ray, hit)){
                 //print out the name if the raycast hits something
                 Debug.Log(hit.collider.name);

                 if (hit.collider.name == "HitObject"){
                     PlayAdditive();
                 }
     }

     function PlayAdditive(){
         Debug.Log("Playing Animation Additive");
         leanLeft.weight = 1.0;
         leanLeft.enabled = true;
     }

Comment
Add comment · Show 3
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 TinyUtopia · Mar 15, 2011 at 09:52 AM 0
Share

I think I discovered the root of the problem. When I load the animation file for the additive process, I do so be referencing it from the animation object. i.e. leanLeft = animTarget.animation["A1LFoot"]; This causes all of the animations in that object to loop even when they are not set to do so.

avatar image TinyUtopia · Mar 15, 2011 at 01:51 PM 0
Share

I tried making a new script from the exact example @ http://unity3d.com/support/documentation/$$anonymous$$anual/Character-Animation.html

This resulted in the same outcome. Even though the additive animation is working correctly, adding the script directly to character GameObject results in the (lower level) animations being continuously looped regardless of their individual settings.

avatar image TinyUtopia · Mar 15, 2011 at 02:54 PM 0
Share

I discovered the problem. The Wrap$$anonymous$$ode of the Character GameObject is deter$$anonymous$$ed by the base animation Wrap$$anonymous$$ode, even if it is on a lower layer than the additive animation. This makes sense.

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

No one has followed this question yet.

Related Questions

Issue with animation 1 Answer

Reference clip for Additive blending animation in Mecanim 0 Answers

Blended Animation offsetting 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