As I stated in my previous question, I’m trying to code something similar to this to tell the story in my game.
Now, I can make a single, pre-specified line and speaker’s name work just fine with the code I had, but telling a story that way obviously required for me to use a file to store the strings to pull from.
So I did this.
I saw no problems with it, nor were there any errors caught, but when I tried to run it:
NullReferenceException: Object reference not set to an instance of an object
VisualNovelScript.Update () (at Assets/VisualNovelScript.cs:21)
For the record, that line is:
if (lines[lineNum].StartsWith(“>”)){
I have no idea how to remove this error. Could someone please explain what I’m doing wrong?