HELP! stuck on wall jump Unity 2D

Okay let me start of with the normal:

Im new to Unity,
I have only been coding in C# for about a week,
I apologize if my code looks messy.

I am having the right bollock ache with getting my little 2D guy jumping off of a wall.

the Y axis is fine… the player jumps according to what number I decide should be the force for jumping up when against a wall


for the life of me i can not get him to jumpBackwards away from the wall

here is my code…

using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour {

// moving 
public float MaxSpeed = 10f;
private bool faceRight = true;


public float airControl = 0.5f;
public float JumpForce = 300f;
public float doubleJumpForce = 2f;
private float maxJumpTime = 0.1f;
public int jumpNumber; 
public int totalJump = 2; 
private float timer;
private bool canJump;

// What is Wall / Wall Jump

public bool TouchingWall = false;

public Transform WallCheck;
public LayerMask whatIsWall;
private float WallRadius = 1f;

public int PushForceRight;
public int PushForceLeft;
public float WallJumpForce;

// What is Ground
private float groundRadius = 0.2f;
public bool Grounded = false;
public Transform groundCheck;
public LayerMask whatIsGround;
public bool touchingWallLeft = false;
public bool touchingWallRight = false;

// crouch

private bool crouch = false;

// Spawning

public Transform target;

// Animator

Animator anim;

void Start () {

	anim = GetComponent<Animator>();


void FixedUpdate () {

	Grounded = Physics2D.OverlapCircle (groundCheck.position, groundRadius, whatIsGround);
	anim.SetBool ("Ground", Grounded);

	anim.SetBool ("Crouch", crouch);

	// Wall Jump

	TouchingWall = Physics2D.OverlapCircle (WallCheck.position, WallRadius, whatIsWall);


	// moving

	float move = Input.GetAxis ("Horizontal");
	anim.SetFloat ("Speed", Mathf.Abs (move));

	// When On The Ground

	if (Grounded) {
		canJump = true; 
		jumpNumber = totalJump;
		touchingWallLeft = false;
		touchingWallRight = false;

	if (Grounded) { // movement on the floor
		GetComponent<Rigidbody2D> ().velocity = new Vector2 (move * MaxSpeed, GetComponent<Rigidbody2D> ().velocity.y);
	} else { // movement in the air
		GetComponent<Rigidbody2D> ().velocity = new Vector2 (move * MaxSpeed * airControl, GetComponent<Rigidbody2D> ().velocity.y);

	if (move > 0 && !faceRight) // flips the direction of character
		Flip ();
	else if (move < 0 && faceRight)
		Flip ();


void Update(){

	if (Grounded && Input.GetKeyDown (KeyCode.Space)) { // Jump
		timer = 0;
		canJump = true;
		GetComponent<Rigidbody2D> ().AddForce (new Vector2 (0, JumpForce));
	} else if (Input.GetKey (KeyCode.Space) && canJump && timer < maxJumpTime) { // Jump Higher when pressed longer

		timer += Time.deltaTime;
		GetComponent<Rigidbody2D> ().AddForce (new Vector2 (0, JumpForce));

	} else if (Input.GetKeyDown (KeyCode.Space) && !Grounded && jumpNumber>0) { // Double Jump
		timer = 0;
		canJump = true;
		GetComponent<Rigidbody2D> ().velocity = new Vector2 (GetComponent<Rigidbody2D> ().velocity.x, doubleJumpForce);
	}else {
	}canJump = false;

// HERE IS WHERE MY ISSUE IS *****************************************************

	if (TouchingWall && faceRight) {
		touchingWallRight = true;
		touchingWallLeft = false;


		if (Input.GetKeyDown (KeyCode.Space) && touchingWallRight) {
			GetComponent<Rigidbody2D> ().velocity = new Vector2 (PushForceRight * 1, WallJumpForce); // WallJumpForce works great but pushForceRight does nothing... even when i change the 1 to -1

		if (TouchingWall && !faceRight) {
		touchingWallLeft = true;
		touchingWallRight = false;


	if (Input.GetKeyDown (KeyCode.Space)&& touchingWallLeft) {
		GetComponent<Rigidbody2D> ().velocity = new Vector2 (PushForceLeft * -1, WallJumpForce);

// *****************************************************

	if (Input.GetKey ("down")) { // crouch when down pressed
		crouch = true;
		GetComponent<BoxCollider2D>().enabled = false; // disables box collider 

	} else{
		crouch = false;
		GetComponent<BoxCollider2D>().enabled = true;


	if(Input.GetKeyDown (KeyCode.W)) {
		this.transform.position = target.position; // respawn character


void OnTriggerEnter2D(Collider2D collider)


void HitByLaser(Collider2D laserCollider)
	if(laserCollider.gameObject.tag == "Enemy") { // when player hits Enemy respawn
		this.transform.position = target.position;


void Flip(){ // flips direction of character
	faceRight = !faceRight;
	Vector3 theScale = transform.localScale;
	theScale.x *= -1;
	transform.localScale = theScale;


Right off the bat, it seems you are attempting to change the rigidbody velocity with code. As you have just begun your trip into the world of Unity. I can tell you that that is not a great practice… Since you are moving a body in “physical space”, the more trusty method would be to apply force to your object using Rigidbody.Addforce(). I will not go into detail explaining it currently, as there is MUCH documentation.

When you perform your wall checks and input checks, you could call
rigidbody.AddForce(PushForce, Forcemode.Impulse);
This would apply your force in an instant.
Also I would try experimenting with adding another multiplier into your Addforce(), for debugging, so you can see if the force is being applied but only a teensy bit.
Something like …
rigidbody.AddForce(PushForce*multiplier, Forcemode.Impulse);
Where “multiplier” is a public variable(so you can view and tweak it at runtime)high number.(I would start at 100 at least)