Sometimes 2 points get added to the score instead of 1, which i don't want.
Mayhem_Madness
Member, PRO Posts: 168
Hi everyone, i have a little problem, sometimes two points get added to the score when pressing a button instead of 1. I only want 1 point to be added.
I have put in the rule, when touch is pressed- change attribute game.score to game.score+1.
Anyone have any ideas on why its adding 2 points instead of 1?
Thanks.
Comments
Somewhere in your rules, you have another change attribute behavior that is adding one to that value. You may want to turn rules off and/or delete actors from the scene until you discover the cause. It could be as simple as having an unlocked actor on the scene with unique "instance" rules. Try deleting the offending actor and re-adding it to the scene.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks for the quick response tatiang.
I have two game modes that use the same game.score attribute,
i have now changed that so the other game mode uses a different score attribute, which is game.score 2.
But its still happening.
@Thor
Are you double tapping?
No I'm not double tapping
@Thor
Delete the change attribute rule game.score to game.score + 1.
See if the points are still being added.
The points don't get added.
Can you post a screenshot?
Of what? The rule?
Yes
If i was double tapping, what would i need to change, or what rule would i need to add for that not to happen?
So if you turn off that one rule, the value of game.score doesn't change at all? Have you checked scene-->layers to make sure you don't have multiple copies of that actor on the scene? Another test would be to create a brand new blank scene and add the actor to that scene. When you do that, what happens when you click on the actor?
If it's still adding two in the new scene, post a screenshot of the rule.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
These are the kinds of problems that are often very simple to solve when you have the project file in front of you but very difficult via back and forth messages. Often people (not saying you're this way) leave out important details such as "I have eighteen copies of this actor in the scene, all stacked on top of each other" or "My rule is embedded in a timer that's embedded in a rule that checks a boolean value that..."
Anyway, hopefully we can figure out what's wrong!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Hi tatiang, i think i may have figured out what it was, i think it was a timer issue.
Glad to hear it!
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User