- Home /
Question by
Beurnii · Mar 06, 2019 at 08:44 PM ·
scripting problembuttonparameterspublic variable
public variable in a script on a button
Hi,
My scripte as a public gameObject variable where a link a gameObject so I can access its component.
I want to execute my script from a button, however when I put the script on the "On click () " propriety, i cannot link my game object to it, there is no place to do so.
What should I do?
PS: I'm a new to unity and trying to learn.
Comment
You must not drag & drop the script in the onClick
callbac$$anonymous$$. You have to drag & drop a gameObject from your scene, and you will be able to select the component and the function to call.
Your answer
