Errors after changing script name

Hi,

After changing script name from “Game Status” to “Game Session” I start to display multiple errors on my game screen. I updated the name of related prefab as well, but If I start to play, the ball will not destroy blocks anymore, there will not be any VFX on the screen and the score will not change. I’m sharing the errors on my console as a screenshot.

Btw, if I turn back and continue to use “Game Status” on my files, there will not be any problem on the screen. Everything will work as it’s supposed to be. So, how can I change the name of the script?

Thank you.

Hi,

Welcome to our community! :slight_smile:

NullReferenceException means that a reference (“link”) to an instance is missing. Double click on the error message to see to which line in your code it is referring. If you exposed a field in the Inspector, make sure that it’s not empty.

If you renamed your script GameSession (without a space!), make sure the classname is also renamed.

Hi Nina,

Thank you for your reply. Actually, currently I tried to change the name again and it works now. And the thing is I did not make anything new; saved the names of scripts and prefabs in same way. I guess I’m having some issues with both Visual Studio and Unity Editor. Sometimes the action of save does not affect related apps.

Thank you for your support, have a nice day :slight_smile:

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

Privacy & Terms