Hi Everyone here,
I’m trying to move my player to the left or right using UI Buttons with a touchscreen
but when I use the ‘on Click()’ event trigger I have to release the button and press it again to make the player move.
I tried the ‘PointerDown’ event trigger but it doesn’t work either.
this is the part of code i use to move the player left or right:
public void RightButton()
{
MyTransform.Translate(Vector3.right * playerSpeed * Time.deltaTime);
}
public void LeftButton()
{
MyTransform.Translate(Vector3.left * playerSpeed * Time.deltaTime);
}