NullReferenceException error?

Hey Rick I did same stuff as you but I keep getting when i try to start it

“NullReferenceException: Object reference not set to an instance of an object
MagicForest.ManageState () (at Assets/MagicForest.cs:28)
MagicForest.Update () (at Assets/MagicForest.cs:23)”

I had this same issue; make sure your script’s file name and the Class name are the same! I toiled over this for an hour because I had my file name set to ‘TextAdventure’ and the class named ‘AdventureGame’. Once I fixed the class name it worked. You may have to copy the text, delete the script, and and make it again. Or replace the game object. Just remember to set your properties like starting script and story text again if you end up going this route.

Capture|690x381

Thank name was same but i did forgot to set “state” in game and i did keep looking for bug in code when it was something different lol

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

Privacy & Terms