Really bewildered : left button not set up

I have the following script im am creating

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

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

function Update() 
{
	if (grounded)
	{
 
	if (Input.GetButton ("Jump"))
		{
			moveDirection.y = jumpSpeed;
		}
		
	if (Input.GetButton ("left"))
		{
			moveDirection.x = speed;
		}
	}
 
	// Apply gravity
	moveDirection.y -= gravity * Time.deltaTime;
	
	// Move the controller
	var controller : CharacterController = GetComponent(CharacterController);
	var flags = controller.Move(moveDirection * Time.deltaTime);
	grounded = (flags  CollisionFlags.CollidedBelow) != 0;
}
@script RequireComponent(CharacterController)

I have followed the error messages advice and went to edit >project settings but the left and right buttons are assigned perfectly fine

I want my character to move with left and right keys and jump with the space key
its a 2D platformer game

Any suggestions unity experts :slight_smile: lol

Is the ‘Jump’ button set up?

yeah no error reports for the jump button :confused:

Have you checked the 2d sidescroller tutorial? Not asking to be annoying, but a lot of the problems I have I can usually pinch ideas/script from one of the tutorials and in this case, the 2d sidescroller tut…

Make sure that the “Name” of the input axis is “left” exactly. If it’s “Left” it won’t work, because capitalization matters. The key you set for the input axis isn’t what it’s checking, just the name of the input axis.

thanks for all your suggestions

funily enough, i did look at that example when I lost the will to live with all the errors i was getting lol

I still struggled understanding most of the code :confused: but al keep going through - its a learning curve :smile:

I shall go check once more for the Left // left suggestion Gargerath

let you know what happens in a bit

I found a work around after a while of pondering over Vector3() and corrisponding axis

although the buttons for left and right arent being recognised ; this works just as I wanted it to anyway :slight_smile: