Cannot add button object to Script in Inspector

29 Views Asked by At

I have a MonoBehaviour script which have slots for buttons to act as a vehicles gas pedal and break pedal but i am unable to drag the button object on those slots.

public Mybutton gasPedal;
public Mybutton brakePedal;
public Mybutton leftButton;
public Mybutton rightButton;

enter image description here

It shows that black stop sign when i drag over it. Already checked if there is another script with same name, also tried adding component to the object.

1

There are 1 best solutions below

0
saqib On

The issue was resolved with the help of derHugo's comment. I had an script named Mybutton which i had to add as component to the button object.