Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 WTDrew · Mar 14, 2016 at 08:26 AM · animationanimatormecanimlayers

Animation motion on base layer does not play after additional motion on second layer

I apologize for the length of this question, but I could not figure out how to ask it without a substantial amount of context.

I'm working on a project where we're using Unity's animation system to animate some UI elements. In several cases we want to have a base UI animation, and play additional simultaneous UI animations based on various animation triggers. I am attempting to use animation layers to do this, however when I play an animation on a layer other than the base layer, all future base layer animations appear to cease functioning.

I have set up and attached a simple sample project that simulates the use case (I had to strip out the library folder to fit under the upload limit). While the sample scene is running, if the user presses any key (or clicks with the mouse), a simple animation will start. This animation is intended to enable a small red sprite, moves it a short distance in the X & Y direction, then enable a small blue sprite, moves it a short distance in either the X or Y direction, then move both of those sprites back to the origin and disables them.

I have set up the animation state machine for this animation thusly:

alt text

  1. The BaseState has no motion attached.

  2. RedSpriteIn enables the red sprite and moves it to (5,5). A behavior is attached to RedSpriteIn that randomly generates a number 0 or 1. If a 0 is generated the state machine transitions to BlueXIn. If a 1 is generated the state machine transitions to BlueYIn.

  3. BlueYIn enables a blue sprite and moves it to (0,5).

  4. BlueXIn enables a blue sprite and moves it to (5,0).

  5. RedSpriteOut moves the red sprite to (0,0). A behavior is attached to RedSpriteOut that sets the trigger "RedOutStateBegin" in the animation parameters.

  6. SpritesOff waits 60 frames and then disables both the red and blue sprites.

In addition I have two other, nearly identical, layers in the state machine. These two layers each have an empty animation state as the default state, which transitions to a state the moves the blue Sprite to (0,0) either from (0,5) or (5,0) as appropriate.

All of this functions as expected, until I get to the SpritesOff state. After the animations in the layers play, the animation in SpritesOff does not play. Disabling the animations in the layers prompts the correct behavior from SpritesOff, but, obviously, that means the animations in the layers do not play properly.

I know this problem can be solved by removing the layers and adding additional states, but I am hoping to avoid that as it forces our artists to create multiple animations that are almost but not quite identical. I want to be able to play two animations simultaneously in the same state machine. Any advice would be appreciated.

unityanimexample.png (38.1 kB)
animtesting.zip (67.4 kB)
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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How to superimpose two animations using the animator? 0 Answers

Animator Layer executes when weight equals zero 1 Answer

Animation in edit mode with Mecanim 0 Answers

Correct way to use mecanim and AddMixingTransform? 1 Answer

C# Help with setting up jump animation 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