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 /
  • Help Room /
avatar image
1
Question by JulesPomme · Sep 16, 2015 at 03:30 PM · animationanimator controlleranimationclip

Duplicate AnimationController ?

Hello! I have a fighting game with a prefab of a character instantiated twice, one for each opponent, so I can make my tests.

For the animations, I have a unique AnimationController for my two characters. In addition of standard animation states (Idle, Walk, Jump, etc.), I have a another state, for the special hits, and each time a special hit is triggered by the player, I attach its corresponding AnimationClip to the state, via a script. This avoids me to create a state for every special hits of every characters I will create in the future.

So if Player 1 triggers for instance a Hadouken, the Hadouken AnimationClip is associated to the Special Hit state, and then the animation is launched via a trigger variable. If now Player 2 triggers a Shoryuken, I put the Shoryuken AnimationClip in the same Special Hit state, and again launch the animation.

My problem is obvious: if Player 1 AND Player 2 trigger two different hit at the same time, I can't put two AnimationClips in the same state. My solution would be to create two clones of my AnimationController at the starting of the game, and use these ersatz instead, but I don't know how to do that. Any idea please? Or maybe I'm using a wrong method with my unique animation state?

Thanks !

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

Answer by plagas36 · May 12, 2016 at 01:28 PM

Hey Jules, Not sure you'll need the answer after that much time but here I go anyway.

The problem comes from the fact that you're using the same animatorController from two differents characters.

If I were you I would duplicate my animator for each character. I would probably change your method and make multiple states.

I'm sure that at some point some of your character will have different attacks and/or moves than the others.

What you should be doing in that case is to create one animatorController with the typical structure. Then duplicate it and replace all clips for each character.

I've done something like that a few months ago. This asset can help you do that if you have a lot of animation clips : video

All of this should help you manage different behaviours. Most important it should clean your code a little bit.

Comment
Add comment · Show 1 · 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 JulesPomme · May 12, 2016 at 06:51 PM 1
Share

Hello, thank you for your answer! Unfortunately, as you said, it's been a long time, and I don't even remember if I fixed my problem or not... Anyway, thank you for other people who might have similar issues :)

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

change player position when animation in played 0 Answers

Why isn't my animation looping? 3 Answers

Animation Constantly Playing? 1 Answer

Character rolls forward,but slides back after animation 2 Answers

[2D] Play animation backward. 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