Hi Chris,
I've been battling for a couple of days with some strange, and frustratingly inconsistent, issues since updating to AC 1.50b and Unity 5.3.1.
Sometimes, upon starting a scene, I receive two errors:
NullReferenceException: Object reference not set to an instance of an object
AC.KickStarter.OnAwake () (at Assets/AdventureCreator/Scripts/Game engine/KickStarter.cs:833)
AC.MultiSceneChecker.Awake () (at Assets/AdventureCreator/Scripts/Game engine/MultiSceneChecker.cs:26)
NullReferenceException: Object reference not set to an instance of an object
AC.MainCamera.Start () (at Assets/AdventureCreator/Scripts/Camera/MainCamera.cs:194)
This seems to interrupt the loading of the UFPS integration script, as I can't move my character, and the AC camera doesn't "wake up" and go to the UFPS camera. The game doesn't crash or hang, just that the UFPS character doesn't respond. This happens regardless of whether the UFPS player is in the scene or not, nor if it's specified in the AC settings as the player or not.
I believe that this is in some way related to the new changes to moveables remembering their positions, as I also get critical errors pinging objects with the Moveable_Drag script attached. There is one error per object.
NullReferenceException: Object reference not set to an instance of an object
AC.DragBase.Start () (at Assets/AdventureCreator/Scripts/Moveable/DragBase.cs:128)
AC.Moveable_Drag.Start () (at Assets/AdventureCreator/Scripts/Moveable/Moveable_Drag.cs:100)
I've performed tests where these objects are disabled, and sometimes that works - allows me to control the UFPS character - but not always. As I said, it's inconsistent. I attempted to create a new scene to demonstrate this issue but, of course, it doesn't always happen.
I've also noticed some issues with moveables whereby they don't always work. I can drag a drawer or cupboard door once, then not again. Or sometimes I need to click on another hotspot in the game before I can once again drag a moveable. That behaviour at least is consistent in my testing. Possibly related - I'm not sure.
Some of my moveables are on hinges and others are on drag tracks, but that doesn't seem to make any difference. I've tested with drag mode set to along a plane, and with starting position remembered on and off. I've tested with an attached Remember Moveable script, also no difference.
With this being such an inconsistent issue (sometimes the errors don't happen at all), I understand that you might have trouble replicating it. Please let me know if you need any more information. I have noticed that if I swap between scenes in the editor, the issue doesn't come up at first, but after changing scenes a few times at runtime (exit back to main menu, hit new game, do this a few times), then it's more likely to occur.
Comments
The second error seems related to the order in which scripts are executed by Unity. Try opening up Unity's Script Execution Order settings and moving MainCamera.cs down below the default.
The third error seems along the same line - it might be that instead you want to move MultiSceneChecker.cs above the default.
You're right that I'm having trouble replicating it - however if you can find out what combination of script ordering fixes the issue, there's a good chance I can do something about it.