Hi i need to move a cube forward when i push a button with the new ui
with my actual script cube move one step when i click the button.
i want it move when button is hold on and stop when it is not.
here is my script:
i bind the button with the cube named “Cabina”, I put a event triger on pointer down.
and bind it with the funtion Forward.
public void Forward () {
Debug.Log("GO forward");
GameObject cube = GameObject.Find("Cabina");
cube.transform.Translate(Vector3.forward * Time.deltaTime);
}