Hello,
(Using Unity 2018.2.12f1 and AC1.71.8)
I've suddenly encountered this bug when i move between scenes in the game.
MissingReferenceException: The object of type 'SpriteRenderer' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.SpriteRenderer.get_color ()
AC.FollowTintMap.ResetTintMap () (at Assets/AdventureCreator/Scripts/Camera/FollowTintMap.cs:138)
AC.EventManager.Call_OnInitialiseScene () (at Assets/AdventureCreator/Scripts/Managers/EventManager.cs:1662)
AC.SaveSystem.InitAfterLoad () (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:608)
AC.MultiSceneChecker.Start () (at Assets/AdventureCreator/Scripts/Game engine/MultiSceneChecker.cs:63)
I am not doing any coding myself. What could be the cause? The only thing I remember doing in the editor player running "continue from last save" even though I didn't have any saves.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The line endings in your error don't appear to match your AC version - is v1.71.8 correct and unmodified?
It's a very old release. Either way, it looks related to your Tint Map. If you open FollowTintMap.cs, what are the contents of its OnDisable function?
Thank you for your answer.
Screenshot: https://ibb.co/Qvw45PV
Thanks for the details.
I'm afraid I can't recreate the issue, but try replacing line 138 of that script:
with:
If that still gives an error, check if the error is exactly the same (line endings included).
I tried replacing that line, but I still got the same error at line 143 instead.
MissingReferenceException: The object of type 'SpriteRenderer' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.SpriteRenderer.get_color ()
AC.FollowTintMap.ResetTintMap () (at Assets/AdventureCreator/Scripts/Camera/FollowTintMap.cs:143)
AC.EventManager.Call_OnInitialiseScene () (at Assets/AdventureCreator/Scripts/Managers/EventManager.cs:1662)
AC.SaveSystem.InitAfterLoad () (at Assets/AdventureCreator/Scripts/Save system/SaveSystem.cs:608)
AC.MultiSceneChecker.Start () (at Assets/AdventureCreator/Scripts/Game engine/MultiSceneChecker.cs:63)
I only get this error after moving between scenes, not when I only play a single scene. The problems are game breaking:
Make a similar change to line 143, i.e. replace:
with:
Thank you! That seemed to fix it.
Except I got the same error at line 130 when I entered scenes that did not have a default tint map assigned. Assigning default tintmap fixed it.
What do you think could have caused this error and what could I do to prevent it happening again?
Can you share the new error in full?