Move Character Left and Right UI buttons don't work

I’m trying to make a mobile 2d platformer. Everything’s fine but the UI buttons don’t move my character left and right. Other buttons like Jump and Attack work just fine. Only the directional buttons have a problem here’s my code for movement:

public float moveSpeed;
private float moveVelocity;

public void Right()
	{
		moveVelocity = moveSpeed;
		Debug.Log ("Right");
	}
	public void Left()
	{
		moveVelocity = -moveSpeed;
		Debug.Log ("Left");
	}

The functions are called with the buttons. The logs appear but the player still doesn’t move.

Is the moveVelocity being applied to the character? Something tells you are not. Since you mentioned the Debug.Log is displaying “Right”, and “Left”.

Can you show the script where you control the character? Here’s an example. You could use force or relative force.

using UnityEngine;
using System.Collections;

// Add a thrust force to push an object in its current forward
// direction (to simulate a rocket motor, say).
public class ExampleClass : MonoBehaviour {
    public float thrust;
    public Rigidbody rb;
    void Start() {
        rb = GetComponent<Rigidbody>();
    }
    void FixedUpdate() {
        rb.AddRelativeForce(Vector3.forward * thrust);
    }
}

Hope this helps.