moving a cube

okay, so i literally am a noob, i only got Unity yesterday and have almost NO experience with it. i have a few very basic lines of code for JavaScript but aside from that i have no idea what im doing. Anyway, im trying to make a cube MOVE not ROLL. im using the arrow keys to control the cube but when i press left or right, the cube will begin to roll.
Any help will be greatly appreciated

So, the basics.

Animation is a modifaction of a parameter over time. Here you want the position to change when an input occures.

In Unity, you can create script that inherit from a certain class and attach them on a GameObject. Unity will then call specific functions at a specific times if you define them them in those script. The usual are Awake (All the awake functions are called first when the scene starts), Start (called once all the Awake are done) and Update (once per frame).

You need to modify the position of the cube each frame if the input is pressed. It’s going to look like that :

function Update() // The name matter. update() won't work.
{
    // By using GetAxis, we use the InputManager. "Horizontal" is q/d or left/right and can be modified.
    //float h = Input.GetAxis( "Horizontal" ); // That's C#, silly me
    var h : float = Input.GetAxis( "Horizontal" );

    // Let's check if the input is pressed. Left is -1, right +1, nothing is 0
    if( Mathf.Abs( h ) > 0.0 )
    {
        // Now, we can move the cube by accessing the Transform component, which contains the matrix
        // To make the movement independant from the frame rate, we use Time.deltaTime.
        transform.position += Vector3.right * h * Time.deltaTime;
    }
}

Thankyou for replying
BUT…
i typed the code java and it came up with-
Assets/Controls.js(8,9): UCE0001: ‘;’ expected. insert a semicolon at the end

i had a quick scan through it and it says that it needs a semicolon in the

float h=Input.Getaxis (“Horizontal”);

Again, any help and i will love you forever