[HELP] Object reference not set to an instance of the object

This has nothing to do with this lesson, but I added an extra roller ball to see what would happen. An error showed up, so I removed the extra ball, but the error persisted.

Screenshots:
Capture

Code:

   private void FixedUpdate()
        {
            // Call the Move function of the ball controller
            ball.Move(move, jump);
            jump = false;
        }

Hi Nathan,

That would suggest that ball has not been instantiated. As none of the scripts have public properties/variables, I’m assuming you are finding/getting a reference in code.

Perhaps if you post the full script?


See also;

Privacy & Terms