Issues with c# script, minor error that I am unsure how to fix

Hi I am having issues with the following piece of code:

{

public float minTarX = 1;
public float maxTarX = 10;
public float minTarZ = 1;
public float maxTarZ = 10;
public float tarX;
public float tarZ;

public float dampX;
public float dampZ;
int timeSwitch = 100;
public GameObject target;

void  Start ()
{
	CreateTarPoint();
}

void  Update ()
{
	if(target != null)
	{
		transform.GetComponent<"NavMeshAgent">().destination = target.position;
	}
	else
	{
		if(timeSwitch <= 0)
		{
			timeSwitch = 100;
			CreateTarPoint();
		}
		else
		{
			transform.GetComponent<"NavMeshAgent">().destination = new Vector3(tarX, 0, tarZ);
			timeSwitch -=1 * Time.deltaTime;
		}
	}
}

void  CreateTarPoint ()
{
	dampX = Random.Range(1.0f, 3.0f);
	dampZ = Random.Range(1.0f, 3.0f);
	
	tarX = Random.Range(minTarX, maxTarX) - dampX;
	tarZ = Random.Range(minTarZ, maxTarZ) - dampZ;
}

void  OnTriggerEnter ( Collider col  )
{
	if(col.gameObject.tag == "Player")
	{
		target = col.transform;
	}
}

void  OnTriggerExit ( Collider col  )
{
	if(col.gameObject.tag == "Player")
	{
		target = null;
	}
}

}

Specifically I am having issues here:

void Update ()
{
if(target != null)
{
transform.GetComponent<“NavMeshAgent”>().destination = target.position;
}
}

Where is says: <“NavMeshAgent”>().destination = target.position; I have a red error with the () parenthesis, I remove them and then I have another error with the full stop, I remove that and then I receive another error with the = symbol. I used a conversion system to bring this code to c# from Javascript. Would someone please be able to assist me? Thanks in advance.

Hi,

There might be other things, but start with removing the “” around <“NavMeshAgent”>

This is to say the lines should look like this:

 transform.GetComponent<NavMeshAgent>().destination = new Vector3(tarX, 0, tarZ);

As an aside, consider caching your components in the Start(), that way you won´t spend resources finding the NavMeshAgent component every frame.