Erratic trigger behavior, I can't find the fault.

Hi guys, I’m kinda at my wits end here. This is my problem:

I have 2 walls opposite of each other. The player can jump off these walls. There is a trigger collider attached to the player object. When the player jumps off one of the walls, this wall becomes “unjumpable” and the opposite becomes “jumpable”.

I have this script attached to my player:

public bool proccedLeft = false;
public bool proccedRight = false;
public bool procced = false;

void OnTriggerExit2D (Collider2D other)
	{
		if(procced)
		{
			if(other.tag == "LeftWall")
			{
				proccedLeft = true;
				procced = false;
				Debug.Log ("LeftProc:" + proccedLeft);
			}
			if(other.tag == "RightWall")
			{
				proccedRight = true;
				procced = false;
				Debug.Log ("RightProc:" + proccedRight);
			}
		}
	
	}

Both walls share this script:

public class WallControl : MonoBehaviour 
{

	public GameObject oppositeWall;
	private Bouncer jumper;
   	private Renderer myRend;
	void Start () 
	{
		myRend = renderer;
		myRend.renderer.material.color = Color.green;
		jumper = GameObject.FindGameObjectWithTag("Player").GetComponent<Bouncer>();
	}

	void FixedUpdate()
	{
		if(jumper.proccedLeft && tag == "LeftWall")
		{
			gameObject.layer = 13;
			oppositeWall.layer = 9;
			oppositeWall.renderer.material.color = Color.green;
			myRend.material.color = Color.red;

			print("LeftGone");

			jumper.proccedLeft = false;
			jumper.procced = false;

		}
		if(jumper.proccedRight && tag == "RightWall")
		{
			gameObject.layer = 13;
			oppositeWall.layer = 9;
			oppositeWall.renderer.material.color = Color.green;
			myRend.material.color = Color.red;

			print ("RightGone");

			jumper.proccedRight = false;
			jumper.procced = false;
		}

	}

Everything works, but sometimes a procc won’t register. In other words the player jumps off a wall, but the wall stays available. This happens irregularly, I have playtested for 1 hour and have found no patterns. Now I know that in order for jump bool to be true, the trigger must return true when next to a wall. So the trigger works fine since I have no problems with other collisions.

I have tried many different solutions up until now. Tried sticking the wall logic in Update and even LateUpdate. Tried putting the trigger collider on a child object of the player. Tried separating the wall code and adding it to an empty game object. The result is the same. I even played around with the physics timestep.

I can’t find a logical lapse in my code, so it seems to me on paper everything should be functional. The problem occurs not only at high speeds, but at low ones too.

Edit: This is my movement control code:

void FixedUpdate ()
	{	

		float ms = Input.GetAxis ("Horizontal");

		// If the player is changing direction (ms has a different sign to velocity.x) or hasn't reached maxSpeed yet...
		if(ms * rigidbody2D.velocity.x < maxSpeed)
			// ... add a force to the player.
			rigidbody2D.AddForce(Vector2.right * ms * moveSpeed);
		
		// If the player's horizontal velocity is greater than the maxSpeed...
		if(Mathf.Abs(rigidbody2D.velocity.x) > maxSpeed)
			// ... set the player's velocity to the maxSpeed in the x axis.
			rigidbody2D.velocity = new Vector2(Mathf.Sign(rigidbody2D.velocity.x) * maxSpeed, rigidbody2D.velocity.y);



		if(jump)
		{	

			//If condition from update is met, jump and then reset the condition to false.
			rigidbody2D.AddForce (new Vector2 (gtfo,jumpForce) * comboJumps/2);
			jump = false;


			//Prevent the player from abusing the wall.
			if (player.position.x < startPosition.x)
			{
				if (walled)
					gtfo = repelForce * 20;
				else gtfo = repelForce;
				

			}
			if (player.position.x > startPosition.x)
			{
				if (walled)
					gtfo = repelForce * 20;
				else gtfo = -repelForce;

			}
		}

	}

OMG I solved it…ridiculous problem. The boolean “procced” was assigned a false value in 2 scripts resulting in biym. Removing jumper.procced = false from the WallControl script solved the issue.

Can’t believe it -.-.