Move my Character with WASD keys but without arrow keys ? HELP !!

I everyone, i’m making like a Multiplayer PacMan for fun. And i need to know if this is possible to control one PacMan with ‘‘Arrows key’’ and the other one with ‘‘WASD key’’… plz help me, you can take a look on my script (JavaScript) :

var speed = 13;
var jumpSpeed = 8.0;
var gravity = 20.0;

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

function FixedUpdate() {
	if (grounded) {
		
		moveDirection = Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
		moveDirection = transform.TransformDirection(moveDirection);
		moveDirection *= speed;
		
		if (Input.GetButton ("Jump")) {
			moveDirection.y = jumpSpeed;
		}
	}

	//Mettre la gravité
	moveDirection.y -= gravity * Time.deltaTime;
	
	// Bouger le joueur
	var controller : CharacterController = GetComponent(CharacterController);
	var flags = controller.Move(moveDirection * Time.deltaTime);
	grounded = (flags & CollisionFlags.CollidedBelow) != 0;
}

@script RequireComponent(CharacterController)

Hi, @ProXenT Take a look at Following Screen Shot::

Just Change/Set those Alt -ve & +ve buttons in Horizontal & Vertical axes. these [WSDA] keys are Alter natives to arrow [UP, DOWN, LEFT, RIGHT] keys

Then use this pseudo code:

function Update () {
    if (Input.GetKey (KeyCode.W)
       {
      //Do what you want...
       }
    if (Input.GetKey (KeyCode.A))
       {
        //Do what you want...
       }      
    if (Input.GetKey (KeyCode.S))
       {      
        //Do what you want... 
       }

    if (Input.GetKey (KeyCode.D))
       {     
        //Do what you want...  
       }
}

@ProXenT Hope this helps you out, Do accept it as Answer & Vote it Up if you find its HelpFull :slight_smile:

Thanks Dude, but how did you get this screen ?

The InputManager…

I’m a noob in programation, i don’t know anything of what o have to do… i get my script (as you see on top) but i dont know what i have to change…

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)’.

i am very very very new to this stuff every time i do a code it doesn’t work please tell me how!!!