(Need help ASAP) Can't get my sprite moving. Think I tried everything.

As above, right now I am making a project in my school. The problem is that I cannot move my “sprite”. I inserted a picture of a character we set as a sprite, I also inserted a picture of a the ground. Both are set to sprites, they also have a box collider, my character also have rigdbody. Now to the script, I tried so many ways to get my sprite moving but it wont.

This is my lastest script I tried:

using UnityEngine;
using System.Collections;
public class Movement : MonoBehaviour {
    // Use this for initialization
    void Start () {
    }
 
    // Update is called once per frame
    void Update ()
    {
        Movement ();
    }
         void Movement()
    {
        if(Input.GetKey (KeyCode.D))
        {
            Transform.Translate(Vector2.right * 4f * Time.deltaTime);
        }
        if(Input.GetKey (KeyCode.A))
        {
            Transform.Translate(Vector2.right * 4f * Time.deltaTime);
        }
    }
}

Any suggestions?
Thanks.

PS.I had the script equppied. It gave me an error telling.
"
Movement.Movement()': member names cannot be the same as their enclosing type

I don’t see the script attached to the sprite.

It was took the picture after :slight_smile: It told me when I tried to play.
"
Movement.Movement()': member names cannot be the same as their enclosing type

Rename the function Movement to something else. That name is reserved for constructors.

still not working :\

You’re still calling ‘Movement()’ in the update loop even though you renamed it. In the movement function it need to be ‘translate’ and not ‘Translate’.