Make button move character?

So I have a button on the screen. I want the button to move the character whenever its pressed.

Here’s the code i have so far

public void left(string leftcircle) {

			GetComponent<Transform> ().RotateAround (Vector3.zero, Vector3.forward, -xRotate);   //= Quaternion.Euler (0, 0, xRotate); 
			

	}

This is attached to the button so obviously whenver it is pressed, the actual button moves. So is there a way to tell it to move the object and not the actual button?

Attach the script to the object you want to move, not to the button. Then choose your button, in its options find the OnClick() box, press “+”. The line consisting of an input field will appear. Drag and drop the object to this field, then click the combobox to the right from the field and find a line that’s called “left”.