Enemy AI Script Error

Hey guys,

Currently I’m trying to create a enemy AI that follows the player once it hits the raycast. However I’m getting 3 errors on my script. I don’t know how to fix them, if anyone could help that would be great, thank you in advance.

The line of code that I’m getting an error with is the very last one, with the GetComponent()

// Update is called once per frame
void Update () {
Player = GameObject.Find (“Player”).transform.position;

	Xdif = Player.x - transform.position.x; 
	Ydif = Player.y - transform.position.y; 
	playerDirection = new Vector2 (Xdif, Ydif); 

	if (!Physics2D.Raycast (transform.position, playerDirection, 5, Wall)) { 
		GetComponent<Rigidbody2D>().AddForce (playerDirection.normalized = speed);

	}

}

This line GetComponent<Rigidbody2D>().AddForce (playerDirection.normalized = speed);
doesnt makes sense, you are missing something there like “" or "”. The error thats coming is, as @MehulRughani said because Vector3.normalized is a read only and returns the normalized vector so you cannot assign a return function for obvious reasons