How do I solve this error?

Whenever I try to make a PlayerController script, I keep getting the same error, which is:

(!) MissingReferenceException: The object of type ‘Object’ has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object.

I am getting this error even whilst I am using Unity’s example code for learning how to use the system, such as their Roll A Ball tutorial. I’ll follow the tutorial, and write the script exactly the same as they have it in the video, with every character being perfect, and following any added annotations, but yet it still doesn’t work at all. Please help me.

![1]

Do you have a rigidbody component attached to the same object ?, I don’t see any other reason you would get a null reference exception.

Do you have any other script communicating with this one?, otherwise you probably forgot to attach a rigidbody to the object.

For some reason it fixed it’s self in an earlier build of the game.