C
C#ā€¢9mo ago
BlackScorpius

ā” Adding score

I'm making a catcher game and currently trying to code it so the score goes up when the falling object lands in the catcher. This is the code I have and I'm not sure why it isn't working. Any help would be appreciated
No description
10 Replies
Pobiega
Pobiegaā€¢9mo ago
not very much information here What entity has "ScoreKeeper" attached to it? Are you sure the collision handler is triggering? Is Collision the right thing, or did you want to inject Collider?
BlackScorpius
BlackScorpiusā€¢9mo ago
I'm putting this script on what's catching the coins I just checked and the collision is registering but the if statement isn't As for your last question I'm not sure what you mean I'm very new to this so I'm not sure what the difference would be
Pobiega
Pobiegaā€¢9mo ago
Try using Debug.Log to print the game object name of the collision, to verify that your assumption is correct
BlackScorpius
BlackScorpiusā€¢9mo ago
Ohhh, because of the way I was spawning them the coins were actually called "Coin Probuilder(Clone)" that's so annoying Now it's working, thank you for the help
Pobiega
Pobiegaā€¢9mo ago
šŸ‘
BlackScorpius
BlackScorpiusā€¢9mo ago
Idk if you're going to check this again but would you happen to know how to make it so it only triggers when the inside of the catcher is hit and not the sides?
Pobiega
Pobiegaā€¢9mo ago
ĀÆ\_(惄)_/ĀÆ I don't do Unity try asking in $unity
BlackScorpius
BlackScorpiusā€¢9mo ago
Thank you
Accord
Accordā€¢9mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts