Hello All,
I’m doing the Roll a Ball tutorial and can’t seem to solve the reference error.
The error indicates a specific line - line 20 in the script that is incorrect.
“NullReferenceException: Object reference not set to an instance of an object
PlayerController.FixedUpdate () (at Assets/scripts/PlayerController.cs:20)”
Here attached the script.
Any ideas for a fix?
Thank you,
Eco-Editor

It means that it was unable to access the Rigidbody component on the object that this script is attached to.
In the editor. click on the object and go to Add Component → Physics → Rigidbody.
EDIT:
The ‘void Start()’ you have is misspelt! (On line 8, it should be void Start, you put ‘Stars’)
1 Like
Hi There, welcome to unity. I’m fairly newbish to C# myself although I have been here long, I like to help new folks out.
To you problem it’s telling your it cannot access the Ridgidbody on your rb as you clearly want to assign it in your Start, but you have misspelled it with Stars. That should sort it out. 
Thank you! That fixed it. 