Unexpected symbol error

I get this error message:

Assets/enemyAI.cs(48,2): error CS1001: Unexpected symbol `}', expecting identifier

from this piece of code:

void Update() 
	{    
		attacktimer += (1 * Time.deltaTime);

		patrolTimer += (1 * Time.deltaTime);

		if (attacking != true) 
		{
			if (targetPoint != null) 
			{
				Vector3 dir = targetPoint.position - transform.position;
				dir.z = 0.0f;
				if (dir != Vector3.zero) 
				{
					transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.FromToRotation (Vector3.right, dir), rotationSpeed * Time.deltaTime);
				}
				transform.position += (targetPoint.position - transform.position).normalized * moveSpeed * Time.deltaTime;
			}
			rb2d.velocity = Vector3.zero;
		} 
		else 
		{
			if (target != null) 
			{
				Vector3 dir = target.position - transform.position;
				dir.z = 0.0f;
				if (dir != Vector3.zero) 
				{
					transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.FromToRotation (Vector3.right, dir), rotationSpeed * Time.deltaTime);
				}
				transform.position += (target.position - transform.position).normalized * moveSpeed * Time.deltaTime;
			}
			rb2d.velocity = Vector3.zero;
		}

		if (patrolTimer > switchTime) 
		{
			targetPoint = currentPoint.GetComponent<movePointScript> ().GetPoint ();
			patrolTimer = 0.0f;
		}
	}

when I click on the message it takes me to the } above the first else statement (line 20 above)

the solution is probably something small I’m missing since I haven’t used unity in a while.

Thanks

The actual mistake is in the line above the “}”, this line “rb2d.velocity = Vector3.zero;”. Try this “rb2d.velocity = new Vector3.zero;” because it is telling you that it needs an identifier.