Working on 2D movement, problems with jumping

In the section of my 2D char controller where I control jumping, I get this error: The left-hand side of an assignment must be a variable, a property or an indexer (error CS0131) After changing “rigidbody2D.Addforce” to “GetComponent().AddForce” due to the new Unity 5. Anyone got any ideas?

if (Input.GetKey (KeyCode.Space) && (groundThere == true))
{
	GetComponent<Rigidbody2D>().AddForce = new Vector2 (0, jumpForce);
	groundThere = false;
}

try this it will work

  GetComponent<Rigidbody2D>().AddForce (new Vector2 (0, jumpForce));

Did u try “”“GetComponent(Rigidbody2D).AddForce”“” ?? I think it should work

Rigidbody shouldn’t be kinetic and musn’t be attached to an object with a CharacterController