0

I have made a button and I wrote a OnClick function for it, but there is no response when i click on it . I have dragged my gameobject into the button i have created and also selected my function

public Button button;
public Text buttonText;
public string playerSide;

public void playerMove()
{
Debug.Log ("function entered");

buttonText.text = playerSide;
button.interactable= false;

Debug.Log("button disabled");
}
  • 1
    Please add a screenshot of the button connection from the editor to your question. – Programmer Jan 08 '17 at 20:41
  • Check the "**2.Button Component**" from [this](http://stackoverflow.com/questions/41391708/how-to-detect-events-on-the-new-ui-components-with-the-new-ui-api/41392130#41392130) question for how to do this from code. – Programmer Jan 08 '17 at 20:52

1 Answers1

1

enter image description here

It's Working correctly . Follow these step you will be up and running.