Angular Drag not working 2d

Hell, I am following a live tutorial from Unity on top down 2D

But I am having an issue with the angular drag on the player.

This is the script

public float speed;

	public Rigidbody2D rigidbody;

	void Start() {
		rigidbody = GetComponent<Rigidbody2D> ();
	}

	void Update() 
	{

		var mousePosition = Camera.main.ScreenToWorldPoint (Input.mousePosition);
		Quaternion rot = Quaternion.LookRotation (transform.position - mousePosition, Vector3.forward);

		transform.rotation = rot;
		transform.eulerAngles = new Vector3 (0, 0, transform.eulerAngles.z);

		rigidbody.angularVelocity = 0;
		float input = Input.GetAxis ("Vertical");
		rigidbody.AddForce (gameObject.transform.up * speed * input);
	}

The player does follow the mouse and move toward it but, it is sliding all over the map, making it game killing.

in the tutorial this is how to script is written

public float speed;

	void Update() 
	{

		var mousePosition = Camera.main.ScreenToWorldPoint (Input.mousePosition);
		Quaternion rot = Quaternion.LookRotation (transform.position - mousePosition, Vector3.forward);

		transform.rotation = rot;
		transform.eulerAngles = new Vector3 (0, 0, transform.eulerAngles.z);

		rigidbody2D.angularVelocity = 0;
		float input = Input.GetAxis ("Vertical");
		rigidbody2D.AddForce (gameObject.transform.up * speed * input);
	}

But comes up with an error regarding AddForce and angularVelocity not having a definition.

The first script does work but Angular Drag is not effecting it at all.

Do anyone know why the player sprite is sliding around the screen. Even once the move button is released the player is still sliding in that last direction.

Thanks

Angular Drag will stop the rigidbody from spinning but you are scripting its rotation this is why it has no affect.

you want to change the rigidbody’s linear drag to make it slow down when you stop applying force.

However having a quick play you might need to add in code to kill the velocity of the rigidbody when it reaches the mouse position with Rigidbody2D.Velocity = Vector2.Zero, If you want it to stop dead on the mouse position.

Hello! Bit late to the party, but if anyone else has the problem, I had to:

Rigidbody2D somethingcool = this.GetComponent<Rigidbody2D>();
somethingcool.AddForce(gameObject.transform.up * speed);

instead of:

rigidbody2D.AddForce (gameObject.transform.up * speed * input);