I just wanted to share an issue that I faced when changing properties to the added Rigidbody on my gameObject. When changing mass or gravity to the Rigidbody there was a null reference error message. I had to explicitly get the Rigidbody component and assign it to the rb variable after adding it to the gameObject, this way the issue was solved.