if(Input.GetButtonDown(interactButton)) // this button is from the Input setting where the Interact button is actually a “MOUSE 0” a.k.a Left click and I want this to change to UI button when the player pressed something happens. I dont know how to do that :‘( Please help :’(
{
//My statement
}
Hello there.
OK, to make the user interact with you app using the new UI system in unity is as follows:
- Create a component (script) with a public method/function and attach it to an empty game object or whatever you choose.
- Create a UI-Button using the menu item: Game Object > UI > Button.
- Select the new button and drag & drop the game object with the component that you create.
- Use the drop down menu to select the method/function that you defined within your component, example: public void MakeALotOfNoise() { }, where MakeAlotOfNoise will be the choice.
So, as you can see there’s how to make a Button do something inside your app, if you require more info about the new UI, check the documentation, cheers.