Input.GetButtonUp Problem

No errors are present. When I take away the Input.GetButtonUp it works fine, i can run right through the item and it goes into inventory. But I add it and when im on top of it and have contact, the button does nothing.

I did make a new Input option called PickUpKey and set the Positive and negative, both and separately to “c” and still not picking it up.

Any ideas??

function OnTriggerEnter(col : Collider){
	col.gameObject.tag == ("Player");
        canPickUp = true;
    if ( Input.GetButtonUp("PickUpKey") && canPickUp == true)
		{
		    theItem.PickUpItem();
		}
	}

The button-up would have to happen at precisely the same frame as the trigger is entered. Unlikely. You should check input button up in an Update function.

On TriggerEnter is only called for one frame.

Input.GetButtonUp is also only called for one frame.

Ninja or not, pressing the key at the exact same time you touch the item within 1/60th of a second will be very difficult, and is almost certainly not the behavior you want.

Take the if out of OnTriggerEnter and put it in Update. Also make sure you set canPickUp false OnTriggerExit and set theItem during OnTriggerEnter so the script knows which item is to be picked up.