Left/Right Input not Functioning

I’m working on a state machine that handles numerous behaviors, but on load, the A/D keys do not move the player object to the left or right. The jump function works, but using A or D will render Jump inaccessible. There are currently no errors in the compiler, or in MonoDevelop that are helping to identify the problem.

using UnityEngine;
using System.Collections;

using System;
using System.Collections.Generic;

public class PlayerStateMachine : MonoBehaviour {
	
	private enum PlayerStates
	{
		IDLE,
		RUN,
		ENTER_JUMP,
		IN_AIR,
		DEAD,
		
		NUM_STATES
	}
	Player thePlayer;
	PlayerStates curState;
	Dictionary< PlayerStates, Action > fsm = new Dictionary<PlayerStates, Action >();
	
	[SerializeField]
	private float maxJumpButtonHoldTime = 0.28f;
	private float timeHoldingInput = 0.0f;
	private bool canJump = true;
	private bool onGround = true;
	[SerializeField]
	private Transform groundCheck;
	[SerializeField]
	public Transform spawnPoint;
	[SerializeField]
	private LayerMask walkableLayer;
	[SerializeField]
	private float groundCheckRadius = 0.1f;
	[SerializeField]
	private float playerHealth = 100;
	
	
	void Start ()
	{
		thePlayer = GetComponent<Player>();

		if (thePlayer == null)
		{
			Debug.Log ("PlayerStateMachine:Start() - We could not retrieve the player component.");
		}
		fsm.Add ( PlayerStates.IDLE, StateIdle );
		fsm.Add ( PlayerStates.RUN, StateRun );
		fsm.Add ( PlayerStates.ENTER_JUMP, StateENTERJUMP);
		fsm.Add ( PlayerStates.IN_AIR, StateINAIR );
		fsm.Add (PlayerStates.DEAD, StateDead);
		SetState( PlayerStates.IDLE);
	}
	
	void Update ()
	{
		fsm[curState].Invoke();
	}
	
	void CheckForGround()
	{
		onGround = Physics2D.OverlapCircle(groundCheck.position, groundCheckRadius, walkableLayer);
	}
	
	void HandleLandOnGround()
	{
		float direction = Input.GetAxis ("Horizontal");
		canJump = true;
		if(direction != 0f)
		{
			SetState(PlayerStates.RUN);
		}
		else
		{
			SetState(PlayerStates.IDLE);
		}
	}
	
	
	void HandleHorizontalInput ()
	{
		float direction = Input.GetAxis("Horizontal");
		float magnitude = Mathf.Abs(rigidbody2D.velocity.x);
		
		Vector2 accel = new Vector2 ( thePlayer.RunAccel() * direction, 0 );
		
		if( direction != 0f)
		{
			rigidbody2D.velocity += accel;
		}
		
		if (magnitude <= 0.1f)
		{
			rigidbody2D.velocity = new Vector2( 0, rigidbody2D.velocity.y);
		}
		
		else if(magnitude >= thePlayer.MaxRunSpeed() )
		{
			rigidbody2D.velocity = new Vector2( thePlayer.MaxRunSpeed() * direction, rigidbody2D.velocity.y);
		}
	}
	
	void SetState(PlayerStates nextState)
	{
		if (nextState != curState)
		{
			timeHoldingInput = 0;
			curState = nextState;
		}
	}
	
	void StateIdle()
	{
		CheckForGround();
		if (onGround == false)
		{
			SetState(PlayerStates.IN_AIR);
		}
		
		if( Input.GetAxis ("Horizontal") != 0f)
		{
			SetState (PlayerStates.RUN);
		}
		else if (Input.GetKeyDown(KeyCode.Space))
		{
			SetState(PlayerStates.ENTER_JUMP);
		}
		
	}
	
	void StateRun()
	{
		HandleHorizontalInput ();
		CheckForGround ();
		
		float magnitude = Mathf.Abs (rigidbody2D.velocity.x);
		
		if (onGround == false) {
			SetState (PlayerStates.IN_AIR);
			{
				if (Input.GetKeyDown (KeyCode.Space)) {
					SetState (PlayerStates.ENTER_JUMP);
				} else if (magnitude <= 0.1f) {
					SetState (PlayerStates.IDLE);
				}
				
			}
		}
		if (playerHealth == 0)
		{
			SetState (PlayerStates.DEAD);
		}
	}
	
	void StateENTERJUMP()
	{
		rigidbody2D.velocity = new Vector2( rigidbody2D.velocity.x, thePlayer.InitJumpSpeed() );
		SetState (PlayerStates.IN_AIR);
	}
	
	void StateINAIR()
	{
		HandleHorizontalInput();
		
		if (canJump)
		{
			if (timeHoldingInput < maxJumpButtonHoldTime && Input.GetKey(KeyCode.Space))
			{
				timeHoldingInput += Time.deltaTime;
				rigidbody2D.velocity += new Vector2 ( 0, thePlayer.JumpAccel());
			}
			
			
			else
			{
				canJump = false;
			}
		}
		else 
		{
			CheckForGround();
			if (onGround)
			{
				HandleLandOnGround();
			}
			
		}
		if (playerHealth == 0)
		{
			SetState (PlayerStates.DEAD);
		}
	}
	
	void StateDead()
	{
		playerHealth = 100;
		SetState (PlayerStates.IDLE);
	}
	
}

Here is the data model that is being used.

using UnityEngine;
using System.Collections;

public class Player : MonoBehaviour {
	
	
	[SerializeField]
	private float maxRunSpeed = 6.0f; 
	
	[SerializeField]
	private float runAccel = 0.5f;
	
	[SerializeField]
	private float jumpAccel = 0.3f;
	
	[SerializeField]
	private float initJumpSpeed = 3.0f;
	
	
	
	void Start ()
	{
		
	}
	
	void Update ()
	{
		
	}
	
	public float MaxRunSpeed ()
	{
		return maxRunSpeed;
	}
	
	public float RunAccel()
	{
		return runAccel;
	}
	
	public float JumpAccel ()
	{
		return jumpAccel;
	}
	
	public float InitJumpSpeed()
	{
		return initJumpSpeed;
	}
	
}

It appears to me that the error lies within your HandleHorizontalInput code.

You retrieve magnitude before adding the current acceleration, and when it is checked it remains at 0, going into the first IF (magnitude <= 0.1f) and resetting your x velocity to 0.

As for why Jumping doesn’t work, there’s no valid exit from the RUN state once you enter it, because you’re missing a closing bracket after SetState(PlayerStates.INAIR), so the IDLE and START_JUMP states require the character to already be in the air.