Target closet object with tag and get transform?

What I’m trying to do is detect if the object with a certain tag is within range and if it is rotate the gun to face the targeted object. What I have now works on 1 object by name, but can’t figure out how to detect the object if it has another name. I have tried to use findobjectswithtag but am having no luck.

using UnityEngine;
using System.Collections;

public class LaserLook : MonoBehaviour {

	public Transform target;
	public float objectDistance;
	public float rotationDamping;

	void Start () {

		target = GameObject.Find ("Random Material").GetComponent<Transform> ();

	}

	void Update () {

		objectDistance = Vector3.Distance (target.position, transform.position);

		if (objectDistance < 20f) 
		{
			lookAtPlayer();
		}	
	}

	void lookAtPlayer()
	{
		Quaternion rotation = Quaternion.LookRotation (target.position - transform.position);
		transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * rotationDamping);
	}
}

using UnityEngine;
using System.Collections;

    public class Test : MonoBehaviour
    {
    
        public GameObject[] target;
        public float objectDistance;
        public float rotationDamping;
    
        void Start()
        {
    
            target = GameObject.FindGameObjectsWithTag("Enemy");     //It will look for all objects tagged as "Enemy"
    
        }
    
        void Update()
        {
            for (var i = 0; i < target.Length; i++)
            {
                objectDistance = Vector3.Distance(target*.transform.position, transform.position);*

if (objectDistance < 20f)
{
lookAtPlayer();
}
}
}

void lookAtPlayer()
{
for (var i = 0; i < target.Length; i++)
{
Quaternion rotation = Quaternion.LookRotation(target*.transform.position - transform.position);*
transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * rotationDamping);
}
}
}