Hello,
I want to add +1 to my int when pulling right or left my joystick, but the value is added multiple times. I assume it is because i’m in the update behavior, but i have no idea how to do another way. Can you help me?
Here’s my code so far :
public int MenuNumeroApt;
void Update()
{
Debug.Log ("MenuNumeroApt : " + MenuNumeroApt);
LeftStickX = Input.GetAxis ("Horizontal");
if (LeftStickX == 1)
{
MenuNumeroApt=MenuNumeroApt+1;
}
else if (LeftStickX == -1)
{
MenuNumeroApt=MenuNumeroApt-1;
}
}
thanks