snozbot / fungus

An easy to use Unity 3D library for creating illustrated Interactive Fiction games and more.
MIT License
1.59k stars 291 forks source link

Global Variables Null Reference After Working correctly for a first run-through. #1059

Open Monydragon opened 1 year ago

Monydragon commented 1 year ago

Describe the bug I have multiple scenes with flowcharts in each of them with a few global variables. when trying to run the game and initially everything works correctly the global variables work as expected. However after running through and retrying by clicking play on the editor again it causes the error "NullReferenceException: Object reference not set to an instance of an object" and the class that it is referencing is handling global variables.

To Reproduce

  1. Create multiple scenes with flowcharts.
  2. Add global variables on each of the flowcharts to mirror my experience 2 string and 1 bool global variables.
  3. Have C# scripts modify global variables by accessing the flowchart and saving strings/bools to them
  4. Run through multiple times having a flowchart have excute on game started event and having say blocks that have the global variables in them.
  5. Watch for unexpected/crashes/errors.

Expected behavior Global variables to work as expected when running the game.

Screenshots FungusError

Versions & Platform (please complete the following information):

luckcatchyou commented 3 months ago

Have you solved it yet?