Unknown Race Condition NullReferenceException

Hello, after the Saving Race Conditions lecture in the RPG course I started getting the following NullReference:

I made sure that all of my referencing was done in the correct places as Brian has suggested in previous comments, and tried to debug the problem, but it still isn’t working. Interestingly when I have a saved game in Scene 1 and I click play in Scene 2 it has no problem loading back to Scene 1 and doesn’t throw any errors, it’s simply whenever I click play and load into the same Scene that it has a problem.

I’ll include the Console Log and the Weapon Script (since that’s the first thing that shows up, though it may be unrelated). I also apologise if this is not a race condition and rather something small, I just can’t for the life of me figure out what it is! Thank you for any help you can provide!


One thing that Sam does in the course is he places sub folders into a root level “Resources” folder. But when it comes to saving/reloading state it will never find the asset since it wasn’t inside a Resources folder, even if you have them inside a sub folder within Resources like sam done in a later lecture in the RPG course. I’ll suggest finding out where your assets are placed before attempting to change code! :slight_smile:

Hey Brandon, thanks for the reply and for your helpful advice! I had a look through and couldn’t find anything at first but I decided to go forward a couple of lectures to the Hunting Down Race Conditions lecture and my problem ended up being the Race Condition that Sam ends up fixing in the SavingSystem script! So thankfully it all works now, thanks again for your help and hopefully if anyone else has the same issue they can replicate this solution :slight_smile:

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

Privacy & Terms