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 jpthek9 · Aug 23, 2015 at 03:02 AM · animatormecanimanimator controlleranimationsrts

Animation Impulse System?

I'm working on an animation system for an RTS game. Each unit has several animation states: Move, Idle, Engaging, etc.. Units also have a variety of "Animation Impulses" which are animations that get played on top of the animation state. They're for things like shooting or casting a spell. When the impulse finishes, the unit returns to its current animation state.

Using Unity Mecanim Animators, how can I make a system like this? Is there a way to PlayOneShot an animation impulse that reverts back to a base animation when the impulse finishes? I.e. a unit is pointing his gun at the target. The unit fires its gun and acts out the recoil. After the recoil animation finishes, the unit returns to pointing its gun at the target.

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

1 Reply

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

Answer by cjdev · Aug 23, 2015 at 03:31 AM

You can use animator controller layers to overlay animations on top of your base state machine animations. Essentially it allows you to blend or overwrite your impulses on top of your normal animation states. They can also be controlled by scriptable parameters just like the base layer.

Comment
Add comment · Show 2 · 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 jpthek9 · Aug 23, 2015 at 03:50 AM 0
Share

That might be just the thing! Is it possible to "stop" the impulse animation layer to make it not override the base layer?

I.e. if a unit is in the middle of a shooting animation impulse then gets jinxed with a move command. The unit shouldn't be perfor$$anonymous$$g the shoot animation while moving so it needs to stop in the middle of the animation.

avatar image cjdev · Aug 23, 2015 at 04:03 AM 0
Share

The animation layer is blended into the base layer by a percentage deter$$anonymous$$ed by the weight value. You could set the weight to 0 whenever you want the base layer to be sure to take precedence and then the impulse layer wouldn't overwrite your base layer at all.

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

26 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 avatar image avatar image avatar image avatar image

Related Questions

how i can stop the animator to play trigger animation? 1 Answer

KeyNotFoundException in animator 0 Answers

Mecanim - Transitioning to the same animation in reverse 0 Answers

C# Help with setting up jump animation 0 Answers

how to make an animation run continuously while you press a button on the keyboard 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