Move gameObject on UI Button Press

Good day,

So what I want to have is when I press my “GasPedal” button, the gameObject “car” moves forward. When I press the “BrakeReverse” button, the gameObject “car” moves backward.
I know how to do this with GetKey but I can’t seem to find a way to do this with a UI Button.

Can somebody help me? I had this setup but I don’t think I’m doing it right there.

Your problem is very similar to the solution for another question I answered.

Instead of having one button as in my example, have two. One of the buttons EventTrigger should route to functions PressBrake and ReleaseBrake and the other buttons EventTrigger should route to function PressGas and ReleaseGas. Obviously you need to create those functions yourself but it should look pretty similar to the answer I provided there.

@Inze http://unity3d.com/learn/tutorials/modules/beginner/ui/ui-button