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 lessthanthreewizard · Apr 20, 2020 at 01:14 AM · score systemcombo

Combo score counter issues

Hello everyone. I'm trying to create a simple combo scoring system where it multiplies the current combo by 250 and then adds it to the level overall combo score. This is what I came up with so far

 void Update(){
     
                //GameManager.Points represent the combo counter. each 
                // enemy dead is +1  combo 
                currentcombo = GameManager.Points;
     
                comboscore = 250*currentcombo;
         
            }
        
         public void UpdateComboScore()
         {
                LevelComboScore = currentscore + LevelComboScore ;
     }
 
 I'm not sure why but on the first x1 combo the LevelComboScore stays at 0 and after that, it doesn't add up correctly.



Comment
Add comment · Show 2
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 jkpenner · Apr 20, 2020 at 02:41 AM 0
Share

Can you post all code related to your combo's? The issue might be where you're changing the value of Points, or where you're calling UpdateComboScore.

avatar image lessthanthreewizard jkpenner · Apr 20, 2020 at 02:53 AM 0
Share

I've tried calling the UpdateComboScore function on enemy death and I've tried calling it on a button press to see if its actually working but the same thing happens. I've also checked if the points are adding up correctly on the game manager and it seems to be good. $$anonymous$$aybe the way I'm doing this is wrong? Do you have any suggestions on how else I would do this combo score thing?

1 Reply

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

Answer by jkpenner · Apr 20, 2020 at 03:10 AM

I’m not sure what exactly is causing your problem, but for a simple combo handler you could create something similar to the following:

 public int Score { get; private set; }
 public int ComboPoints { get; private set; }
 
 public void ApplyScore(int scoreAmount) {
     this.Score += (scoreAmount * this.ComboPoints);
 }
 
 public void IncreaseCombo() {
     this.ComboPoints++;
 }
 
 public void ResetCombo() {
     this.ComboPoints = 1;    
 }

The ApplyScore would be call whenever an object gives the player score. It will then modify that score amount by the current combo points before applying it to the total score. After you apply a score you would then call IncreaseCombo.

Hopefully this helps you figure out your issue.

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 lessthanthreewizard · Apr 20, 2020 at 09:03 PM 0
Share

This seems like a way better way of doing it than $$anonymous$$e. Thank you! :)

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

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

Related Questions

Ragepixel Animation Help! 1 Answer

mecanim blend tree attack combo 2 Answers

Why my score system not working? 1 Answer

Can add any value to survival score system 0 Answers

Score counter breaking after adding points 2 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