I have a number of objects with colliders in my scene. They’re all using the same tag and I want to increment a variable whenever the player clicks one of these objects.
What is the way to go about this, any links or examples would be much appreciated!
I only know how to use
void OnMouseDown() so far, and only when the script is attached to the object being clicked
I want one script that will increment a variable whenever any of the objects are clicked.