❔ 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
10 Replies
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?
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
Try using Debug.Log to print the game object name of the collision, to verify that your assumption is correct
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
👍
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?
¯\_(ツ)_/¯
I don't do Unity
try asking in $unity
Thank you
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.