Only pick up one log at a time?

Hi, so the thing is, when I am inside pickup range of multiple “logs”, I pick up multiple logs, and not just 1. Since the script is attached to each prefab or “log”, I am not sure how to proceed… I just need a little push in the right direction.

This is my pickup script :

using UnityEngine;
using System.Collections;

public class Pickup : MonoBehaviour 
{	
	private bool canPickUp = false;
	private bool hasLog = false;

	public GameObject log;
	// Use this for initialization
	void Start () 
	{
		log = GameObject.Find ("Log");
	}
	
	// Update is called once per frame:P
	void Update () 
	{
		if(!hasLog)
		{
			if(canPickUp && Input.GetKeyUp(KeyCode.T))
			{
				PickUp();
			}
		}
		else
		{
			if(Input.GetKeyUp(KeyCode.T))
			{
				Drop ();
			}
		}
	}
	void OnTriggerExit(Collider other)
	{
		if(other.collider.tag == "Player")
		{
			canPickUp = false;
		}
	}
	void OnTriggerEnter (Collider other)
	{
		if(other.collider.tag == "Player")
		{
			canPickUp = true;
		}	
	}
	
	void PickUp ()
	{
		//change the position of the object to hand
		gameObject.transform.position = log.transform.position;
		gameObject.transform.rotation = log.transform.rotation;
		gameObject.transform.parent = log.transform;
		gameObject.collider.enabled = false;
		gameObject.rigidbody.isKinematic = true;
		hasLog = true;
	}
	void Drop ()
	{
		gameObject.transform.parent = null;
		gameObject.rigidbody.isKinematic = false;
		gameObject.collider.enabled = true;
		hasLog = false;
	}
}

I figured it out.
Just made a raycast script attached to the player, then tagged my logs.
And whenever i clicked T, hasLog == false, and I’m looking at a log, then I pick it up, and hasLog = true;
And if i press T with “hasLog == true”, I drop it.

Thanks for the help btw :wink:

For some reason, my “Bump” comment got 4 down-votes.
I started with unity 2 weeks ago. Sorry that I come here to ask for help.
I guess this isn’t the place to ask for help after all.