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
0
Question by kkrac · Apr 26, 2017 at 07:36 PM · animatoranimator controlleranimationsoop

Player's God animator vs separate animators?

This might not be a question specific to Unity since it can be more related to a OOP or separation of concerns doubt, but still wanted to know if anyone has faced a situation like this. It probably doesn't have right or wrong answer either.

My scenario is the following:

  • I have a player prefab which has an animator component and a script attached to it that handles the different transitions for the animator (sets parameters, triggers animation, etc.).

  • The player has skills (like in a Diablo-like game). A skill can be a complex attack which can involve several animations, or events within the same animation. Each of those animations or events can perform different kinds of attack. eg: the first movement does one type of damage and affects some of the player stats, the second attack movement does a different damage and can affect other stats, and so on. So, in essence, each skill can be a compound of abilities, where each ability does a different thing.

Now, the question here is which approach is better, in terms of performance and scalability:

  1. to have all the player's animations (including the skills animations) in one single, God-like animator component associated to the player prefab (maybe with each skill in a different layer)? The character controller class will have to call the skill/abilities methods in the Skill class, to actually apply the damage or modify the stat or whatever, whenever an attack skill animation is triggered.

  2. to have one animator component for the player for the base animations (idle, walk, run) and one animator per Skill prefab. The advantage of this is better separation of concerns, so that the skill doesn't have to know anything about the main animator, and the animator and character controller doesn't have to know anything about the skill. But, I'm not entirely sure about how this could scale or perform, when having dozens of skills (and dozens of animators).

Suggestions?

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
0

Answer by theANMATOR2b · Apr 26, 2017 at 08:38 PM

Please don't take my advice as gospel.

My book knowledge says the best setup is to decouple all systems as much as possible so one 'thing' doesn't need to know about another 'thing'. The one thing just needs to receive a trigger/event/param/var/bool - etc etc to let it know to adjust something it controls. The other 'thing' is sending the message when something happens that triggers it to send the message. This other thing knows nothing of the one thing and vis-versa.

And since it sounds like your systems are VERY complex - I'd want to decouple as much as possible - SO - that would allow each 'thing' to be scaleable as much as possible.

You might consider researching some fighting game systems. Although it sounds like your working on a hack-slash type rpg - the animation system in fighting games are structured in a pretty unique way, which sounds conceptually similar to your concept.

You may also benefit from reading through the design thread within the Unity forum. Some great advice worth its weight in gold is hosted in there.

Comment
Add comment · 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

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

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

Related Questions

duplicate enemies animations wont work? 0 Answers

how to Restore corrupted Animator 0 Answers

My animations started acting weirdly 0 Answers

NEED HELP ANIMATING PLAYER MOVEMENT 0 Answers

Animation changes when marked as legacy 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