NullReferenceException: Object reference not set to an instance of an object

i havee this error

Hi there! It’s easier to help if we can see the code causing the error, line 62 in the Session script.

If you’re following the course exactly, the line is probably meant to be this:

FindObjectOfType<ScenePersist>().ResetScenePersist();

If that is the correct line, here are some things to check:

Make sure that your code uses the correct class name, you may have named your ScenePersist class something else.

Make sure you’re using FindObjectOfType not something similar like FindObjectsOfType

hi, i used right code. that error happen at last level (level 3), other level, it’s work

If it’s working in the other levels, double check that you have a game object with the ScenePersist script attached in Level 3.

1 Like

ah, i solved problems, thank you

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms