HELP Plz.. Scripting problem !

Hi everyone, i’m making like a Multiplayer PacMan for fun. but i need to make one pacman movement with ‘‘WASD keys’’ and one with ‘‘Arrow Keys’’ but, I always got error error… what is it ? plz… :

var gravity = 20.0;

private var moveDirection = Vector3.zero;
private var grounded : boolean = false;

function FixedUpdate() {
    if (grounded) {

           if (Input.GetKey (KeyCode.W))
       {
       moveDirection = Vector3(Input.GetAxis("Vertical"));
       moveDirection = transform.TransformDirection(moveDirection);
       moveDirection *= speed;
       }
    if (Input.GetKey (KeyCode.A))
       {
       moveDirection = Vector3(Input.GetAxis("Horizontal"));
       moveDirection = transform.TransformDirection(moveDirection);
       moveDirection *= speed;
       }      
    if (Input.GetKey (KeyCode.S))
       {      
       moveDirection = Vector3(Input.GetAxis("Vertical"));
       moveDirection = transform.TransformDirection(moveDirection);
       moveDirection *= speed;
       }

    if (Input.GetKey (KeyCode.D))
       {     
       moveDirection = Vector3(Input.GetAxis("Horizontal"));
       moveDirection = transform.TransformDirection(moveDirection);
       moveDirection *= speed;
       }

       if (Input.GetButton ("Jump")) {
         moveDirection.y = jumpSpeed;
       }
    }

    //Gravity
    moveDirection.y -= gravity * Time.deltaTime;

    //Character
    var controller : CharacterController = GetComponent(CharacterController);
    var flags = controller.Move(moveDirection * Time.deltaTime);
    grounded = (flags & CollisionFlags.CollidedBelow) != 0;
}

@script RequireComponent(CharacterController)

My error : BCE0024: The type ‘UnityEngine.Vector3’ does not have a visible constructor that matches the argument list ‘(float)’.

This is one of your issues (btw, you can double click on the error to go to your error line):

       moveDirection = Vector3(Input.GetAxis("Vertical"));

Please read up on Vector3 and vectors in the manual.

You are basically missing the other two dimensions of your movement vector. Try something like

  moveDirection  = Vector3(Input.GetAxis("Vertical"), 0, 0);

if you want to move along the x axis for example.

it did’nt work…