GetKeyDown not being called when pressing that key??

Right, so I’m probably going to feel stupid after asking this because I had it working yesterday but when tweaking the script everything melted down for some reason.
Here’s my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CharacterBehavior2 : MonoBehaviour {
	private GameObject player, ball;
	private bool pickedUp;
	void Start () 
	{
		player = GameObject.Find ("User");;
		ball = GameObject.Find ("Ball");
		pickedUp = false;
	}

	void Update () 
	{
		if (Input.GetKey (KeyCode.E) == true) {
			Debug.Log ("Press E");
		}
		Debug.Log ("Update Works");
		/*if (pickedUp == false & Input.GetKeyDown(KeyCode.E)) {
			pickedUp = true;
			PickedUp ();
		}
		if (pickedUp = true) {
			
		}*/
	}

	void PickedUp()
	{
		ball.transform.SetParent (player.transform);
		ball.GetComponent<Rigidbody> ().isKinematic = false;
		ball.GetComponent<Rigidbody> ().useGravity = false;
	}
}

So I have a Debug.Log in there to ensure the Update function is working, which it is. Then I have a Debug.Log for the GetKey and when pressing that key, there is no output from the Log. Idk what to do at this point and I’m almost certain my code is correct, although I clearly doubt it since it doesn’t work. Please help.

Lines 13 and 14 print correctly when I test it in Unity. Are you sure you were pressing the right key and also didn’t just overlook the log statement?

However, I see an error in your commented-out code: On line 21 you say if (pickedUp = true) which should be if (pickedUp == true) with double equal signs for the comparison.

You can also write something like this:

using UnityEngine;

public class CharacterBehavior2 : MonoBehaviour 
{
	private bool pickedUp;

	private void Update () 
	{
		if (Input.GetKeyDown(KeyCode.E)) 
		{
			if(!pickedUp)
				PickUp();
			else
				Drop();
		}
	}

	private void PickUp()
	{
		Debug.Log("Picking it up.");
		pickedUp = true;
	}

	private void Drop()
	{
		Debug.Log("Dropping it.");
		pickedUp = false;
	}
}