Problem with diamond value + score

,

You should go through some tutorials from the Learn section: Learn
Start with the easiest stuff and work your way up. Lessons and small games.

For future reference, if you have a coding question, the best way to share your code is to post it in the thread, using code tags ( Using code tags properly ), so people can view it here.

You could use GetComponent to get the score script on the player, when it enters the trigger of the diamond.
Set a value for the diamond (on its script) that gets passed along to the score script.
Add a public method to increment the score on the score script.

Is your game supposed to steadily increase the player’s score over time? Is that why you have the coroutine?
If that’s the case, just remove the Update loop, because you’re starting a new coroutine every frame, which isn’t what you want. You can let the coroutine run (use ‘StartCoroutine’ in Start(), instead), and update any values in there.

I hope that helps some. :slight_smile: