help in assessing variable

I need help figuring out how to change a variable from another object.
I have one object named Player that has a public float named “size”, and I have a second object named.…Circle that I want to be able to increase size from, but I can’t. This is my code in Circle:
Code (CSharp):

  • void OnCollisionEnter2D(Collision2D coll)
  • {
  • if (coll.gameObject.name == “Player”)
  • {
  • this.GetComponent().size += 1;
  • }
  • }

Whenever I run this code I get a nullreferenceexception error. I am very new to Unity and C#, so please explain it to me like I have no idea what code even is.

this line tries to take playerMovement component from the same gameobject that this script is running,

 this.GetComponent<playerMovement>().size += 1;

so probably you want to do coll.gameobject.GetComponent<…, to take from the colliding object?