I was wondering how to make my player move when I click a UI button. I am more confused on how to code the button to receive the input and move the player until the button is not pressed but would still be happy if someone could help with the movement aswell but the button is more important.
I want it to work like this:
public void whenClicked();
{
if (leftButton is clicked)
move player left
if (rightButton is clicked)
move player right
if (upButton is clicked)
move player jump
}
Ola,ROY uma das formas de fazer isso é criar botões (Canvas UI) e script (Codificação de interface do usuário “Botões”),existe a função On Click, onde é necessário um GameObjct que contém o script (codificado);
1 - Atribua esse GameObjct;
2 - Selecione o método de acordo com a função executada;
Please don’t spam the forum with duplicate questions. Just this morning two separate users here gave you two possible options in the post below:
Which ones did you try out, how did it go, and what is the specific problem you’re having? Have you even worked through a single Youtube tutorial on this? It’s like the most basic simple thing possible: google up unity touch controls. You need to learn the separate steps involved and you need to integrate them. Nobody can do that for you here.