Quests + portal issues

So IDK if it’s just me, but I’m having a weird issue where my quests aren’t going from one scene to the next when I take a portal to the next scene. I haven’t touched the portal stuff in a REALLY long time, so I’m unsure if we changed a bunch recently when we implemented quests, but as of right now I pick up a quest, I use a portal, and the quest is no longer in my quest list (according to my UI). What’re the steps I can do to try and debug this, because it’s not throwing any errors, it’s just, I think, not showing up on my quest list?

I’m also getting a weird issue where the portal is “destroying” the player controller, but is still trying to access it, creating a MissingReferenceException. If I don’t move at all it’ll keep trying to load up the scene, and start an infinite loop, if i can move quickly I can break that loop and continue forward.

I believe i also had a problem with the quest list after moving to a different scene,
if i recall right i fixed it by just refreshing the ui when i press the key to open the questlist ui.
But Brian will probably come with a better solution ;p

You could debug it with making the questlist List a serialize field,
so you can see if its actually empty in the editor.
If its actually empty, its probably something with the saving system.

I seem to remember that i also had some nullreference problems with scene loading,
do not remember how i fixed that.

The missing reference exception is likely not re-aquiring the player after the new scene is loaded. Once the new scene is loaded, any references we had into the scene are invalid and must be re-aquired from the new scene.

Check your QuestList to make sure that at the end of RestoreState, you are invoking the onUpdate event.

IDK what I did, but apparently adding the invoke to the onUpdate made it say it’s got a null reference again haha. I commented it out, and it works just fine? I think the issue with the missing reference was what was messing with the questlist?

I think the issue with the missing reference was the fact that I’m using the same layout of a scene in the next scene (it’s two inn scenes, one before you go to bed, one in the morning, portals are roughly in the same spot) and I think I was just clipping the old portal somehow? I moved the spawner further away and it stopped bugging out for now.

Are you using
onUpdate.Invoke();
or
onUpdate?.Invoke();

I was using the one without the ?. I know sam said, in one of the videos, what the difference was, but I can’t for the love of me remember.

The ? is functionally equivalent to saying

if(onUpdate!=null)
{
    onUpdate.Invoke();
}

Yeah I guess that makes sense, and is on target alongside the nullable bool. Thanks for the help and for answering all my damn questions! haha

Privacy & Terms