• 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
Question by kassikgaming · Apr 18, 2021 at 11:28 AM · systemcombatcombo

i'm trying to create a combo system

so basically I'm trying to create a system that when I click the mouse button it does one attack and it returns to the idle state. then have an option to click the mouse button again within a certain time frame of the first attack so then it can do a second attack animation. but when i do it for some reason one mouse click it registered twice and it triggers both of the triggers of attack1 and attack2 for no reason.

a screenshot of my combat code and animator is below.

alt text alt text

screenshot-2021-04-18-122524.png (40.6 kB)
screenshot-2021-04-18-122604.png (19.2 kB)
Comment
eplaygame

People who like this

1 Show 1
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 kassikgaming · Apr 18, 2021 at 11:37 AM 0
Share

also i forgot to mention for some reason my one mouse click for some reason activates both attacks when I should've had to click the mouse again or wait for the next attack time to be equal to 0

3 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by eplaygame · Apr 18, 2021 at 12:01 PM

I was facing the same problem. Basicly, this approach is the first that I came up with but... It will not work reliably and probably just won't work. It is very (!!VERY!!) complicated method having timers and I recommend You to watch this tutorial.

https://www.youtube.com/watch?v=e2PRI19Igbo

You really will produce many more problems that will very difficult to solve when you adding if statements + timers + animation events.

Comment

People who like this

0 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 kassikgaming · Apr 18, 2021 at 02:49 PM 1
Share

ok i have actually decided to use your recommendation and after a little thinking during the video i managed to modify my current weapon script to that one so cheers for that

avatar image

Answer by kassikgaming · Apr 18, 2021 at 01:11 PM

yeah i watched this tutorial and it did not help what so ever. ill try other ways and see if any of them work but im open to any other suggestions

Comment

People who like this

0 Show 0 · 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

Answer by IronKnigh · Oct 29, 2022 at 05:18 AM

I recommend you read this article by valar05, since they go over in depth about leveraging mecanim to achieve the combo-behavior you would see in more polished games, like trigger-cache cleaning, animation-event based, weapon trail events, and etc... https://grailawakening.wordpress.com/2015/12/06/a-way-to-create-a-combo-system-in-mechanim/

I personally replicated this system as well for a small project of mine and it worked beautifully.

Comment

People who like this

0 Show 0 · 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.

Update about the future of Unity Answers

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta later in June. Please note, we are aiming to set Unity Answers to read-only mode on the 31st of May in order to prepare for the final data migration.

For more information, please read our full announcement.

Follow this Question

Answers Answers and Comments

118 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 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 to make a continuous "combo" system 2 Answers

How to handle undefined targets in a composition based ability system? 2 Answers

Targeting the GameObject I collide with? 1 Answer

Accessing local system ( File Browser ) 2 Answers

3D Combo system? 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