Forum rules - please read before posting.

Possible bugs: NullReferenceExceptions only on certain scenes

Hi,

I'm getting some errors when trying to load certain scenes. I ran a build of each scene individually so it would be easier for me to test things out and the errors only happen on 2 of my 7 scenes. The scene loads and the sound works, the art assets seem to load fine too, but I don't have access to any menus or my cursor.  I'm on AC 1.54b and Unity 5.4.1

I get about 100 rounds of the error listed below:

NullReferenceException: Object reference not set to an instance of an object
  at AC.ActionList.Awake () [0x00000] in <filename unknown>:0

Followed by one instance of this error:

NullReferenceException: Object reference not set to an instance of an object
 
at AC.AdvGame.AssignMixerGroup (UnityEngine.AudioSource audioSource,
SoundType soundType, Boolean isSpeech) [0x00000] in <filename
unknown>:0
  at AC.Sound.Initialise () [0x00000] in <filename unknown>:0
  at AC.Sound.Awake () [0x00000] in <filename unknown>:0

Those two errors loop through several times and then I get the error below towards the end:

NullReferenceException: Object reference not set to an instance of an object
  at AC.PlayerCursor.OnApplicationQuit () [0x00000] in <filename unknown>:0
 
Hope someone can help.

Thanks,
Jason

Comments

  • edited September 2016
    On what platform?

    Do these errors occur if you run these scenes in the Editor?  The error messages from builds aren't nearly as detailed and make it much harder to identify.  Otherwise, check that you have "Development build" checked when you build.

    Is there any difference between the scenes that work vs those that don't?  Are you using any custom Actions or code?  The first error seems related to your OnStart Cutscene.
  • I'm building for PC.

    The errors do not occur in the Editor, only in the builds. After doing a dev build the errors look like this:

    NullReferenceException: Object reference not set to an instance of an object
      at AC.AdvGame.AssignMixerGroup (UnityEngine.AudioSource audioSource, SoundType soundType, Boolean isSpeech) [0x00000] in Z:\Apps\TheSearch_App\Unity\5\TheSearch_2_2015\Assets\AdventureCreator\Scripts\Static\AdvGame.cs:71
      at AC.Sound.Initialise () [0x0009c] in Z:\Apps\TheSearch_App\Unity\5\TheSearch_2_2015\Assets\AdventureCreator\Scripts\Logic\Sound.cs:84
      at AC.Sound.Awake () [0x00000] in Z:\Apps\TheSearch_App\Unity\5\TheSearch_2_2015\Assets\AdventureCreator\Scripts\Logic\Sound.cs:58

    NullReferenceException: Object reference not set to an instance of an object
      at AC.ActionList.Awake () [0x00000] in Z:\Apps\TheSearch_App\Unity\5\TheSearch_2_2015\Assets\AdventureCreator\Scripts\ActionList\ActionList.cs:81
     

    NullReferenceException: Object reference not set to an instance of an object
      at AC.PlayerCursor.OnApplicationQuit () [0x00000] in Z:\Apps\TheSearch_App\Unity\5\TheSearch_2_2015\Assets\AdventureCreator\Scripts\Controls\PlayerCursor.cs:861

    The art assets and sounds are the main differences between the scenes. There are no custom scripts or Actions I'm using. I deleted my OnStart action, but still get those errors. I can try to dig around some more to see if something else looks off.

    Thanks
  • Thanks.  The stacktrace suggests that you don't have your Managers assigned - which can't be the case if your other scenes are working.  Double-checking that all 8 Managers are assigned in your main AC Game Editor window, and that the file /Assets/AdventureCreator/Resources/References.asset is present.

    Also check that there is a GameEngine prefab present in all scenes you are starting from.
  • Chris,

    Everything you mentioned is there. I did another build that links three scenes together, one that works is the starting scene and the following 2 are the "broken scenes". Oddly enough, the broken scenes works fine when I build it this way. These scenes would be linked together in the final build anyway, which was my main concern, so this isn't an issue anymore. Thanks for your time!

    -Jason
  • No problem.  I would've liked to have gotten to the bottom of it, but as no-one else has reported such an issue it could be an isolated case.
  • Hey Chris,

    I had to tackle this issue again since I was getting the same errors on my titlescreen scene, but after digging around some more I saw that I didn't have my ManagersPackage assigned in the GameEngine prefab for any of the scenes. Once I assigned the package everything works as it should. Not sure why some scenes would still work even though the manager package asset wasn't assigned and some wouldn't.

    Thanks again,
    Jason
  • I agree that it sounds like the Managers aren't being correctly assigned, but d you mean the "Required Manager Package" field in the Scene Settings component?  That literally does nothing but display an error message if one is assigned which doesn't match the one that's actually being used - it's used by the demo games to issue a warning to newcomers.
  • Yes, I am referring to the Required Manager Package in the Scene Setting component. I also re-created the ManagerPackage for my game and hit "Assign Managers" after assigning the managers I have been using. When I updated my project to the new AC version I had originally manually drag-and-dropped to assign all 8 managers. So, maybe this was the fix since the missing Required Manager Package only throws a warning? Either way I'm happy everything's working now :)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.