I’m trying to run this code when the user clicks on an object or button, when i assign the code to an object it still registers the click on any area instead of just the object/button. can annyone help?
The monobehaviour class has a number of Unity callbacks related to input on a per object basis: Unity - Scripting API: MonoBehaviour.OnMouseDown()