I have a score system like this:
Everytime my ball enters my trigger, I get 100 points. But what if I want to get 300 points if my ball enters two triggers, or if my ball enters three triggers I get 500 points?
This is my current code, which doesn't account for multiple triggers:
I hope you understand this, and maybe somebody could please help me?
Assuming that your triggers are stationary and do not get destroyed when hit: Add a class variable (call it "timeOfHit" or something) for the time and a class variable for the last trigger hit (you'll need to tag your triggers for a function... more on this later). Then when you hit a trigger record the Time (timeOfHit = Time.time;) and the tag (you'll need to have the trigger return a number or string when the function is called). On the next collision, check to see if the time is close enough to the last time (whatever you want your threshold to be) and you are hitting a different trigger. If so, give multiple points...
On the player:
On the Trigger:
This should work (I haven't tested it)... the important thing is to record which trigger was hit and how long ago (if you want to make the player hit nearby triggers close together for an increased score).