After loading the saved game, QuestItemUI is somehow unable to find a reference to the Quest scriptable object we are trying to reference, so it gives a NullReferenceException. I did a Debug.Log() message right above the line and it is returning Null. As far as I’m aware, my code is the same. I even checked the GitHub commit from this lecture to ensure everything is typed out as it should be. Any ideas on why this might be happening?
Is your Quest in a folder named Resources?
Well, yes and no. The hierarchy of my folders is Game > Dialogue > Resources > The Magic Tree > Dialogue in question
Can it not be in a folder within resources? I’m away from my computer so I’m unable to check at the moment.
It can be a folder within Resources as long as you are using a Resources.LoadAll() instead of Resources.Load() (With Load, you also will need to specify the path!).
Paste in your QuestList method, as well as your QuestItemUI and we’ll take a look.
Got it figured out. I somehow thought it would be a good idea to put the dialogue in the resources folder when I should be putting the quests in. Got confused there for a while. Thanks for your help!
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.