First, please check this thread for how to post code nicely on the forums: Using code tags properly
Change this bit :
Rigidbody rb;
private void Start()
{
rb = GetComponent<Rigidbody>();
}
Replace any ‘rigidbody’ with ‘rb’ in the rest of your code and report back how that goes. Please post with code tags, if you have more issues. In the future, it would be helpful if you included the error message when you post an issue, as well.
Hope that helps.