C
C#15mo 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
Pobiega15mo 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
BlackScorpiusOP15mo 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
Pobiega15mo ago
Try using Debug.Log to print the game object name of the collision, to verify that your assumption is correct
BlackScorpius
BlackScorpiusOP15mo 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
Pobiega15mo ago
👍
BlackScorpius
BlackScorpiusOP15mo 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
Pobiega15mo ago
¯\_(ツ)_/¯ I don't do Unity try asking in $unity
BlackScorpius
BlackScorpiusOP15mo ago
Thank you
Accord
Accord14mo 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