Ok, hello to yo all. I am trying to use the new Ui to make a two buttons to move left and right. I made the jump button very easy, but I can’t figure out how it will work with the movement. I have this function and I want to simply call it when the button is clicked
void OnButtonClicked () {
if (allowmove == true ) {
float move = Input.GetAxisRaw ("Horizontal");
rigidbody2D.velocity = new Vector2 (move * maxSpeed, rigidbody2D.velocity.y);
}
}