Hi
There is an object in the scene. There are two UI Buttons up & down in the scene. What I want, when user touches the up button, object should move forward and the moment user releases his finger (untouches the button) the object should stop. And I want same for down button to move the object backward.
Currently with the code
public void moveUp(){
rigidbody.position=new vector3(transform.position.x, transform.position.y, transform.position.z+5f);
}
I could able to move the object. But user has to continuous tap on the up button to move the object forward.
I want once user touches the up button, the object should move forward and the moment he releases it should stop. HOpe you understand my requirement.