I’m just beginning with learning Unity and I feel a bit silly about needing to ask this.
I have a very basic set-up where I have a prefab of a target and instances of that target are instantiated faster and faster. The prefab has a script where the object is destroyed if it is clicked (using on mouse down). I want your score to increase every time you click a target but I have no clue to do this. I currently have a separate game object called “ScoreTracker” with a script that has the score variable I want to update, but Unity doesn’t seem to let you put references to other scripts into prefabs (if anyone knows why, please explain because I’d love to learn about it) so I can’t update the score from the prefab instance itself. I’ve tried researching this but have concluded that I must be doing something completely wrong and I’m not sure what to do. So, how is something like this usually handled?