0
Under review

Quest UI being destroyed atfer completion, Unable to use again

Sam Leitch 1 week ago in Quests updated by Marti (Lead Developer) 5 days ago 1

Hello again,

This error occurs only if i have a tracked quest on the hud, complete it and then try to complete a second quest.

Same two quests completed without being 'tracked' and i can complete them every time no issues.

I have it set to only show tracked Quests. Having this diactivaed, so showing both quests available on screen at once. It does not crash and bring up the error.


I would like to keep my UI uncluttered and only keep the currently tracked quest on screen. Would love some advice if available.

Kind regards,

Sam


 

MissingReferenceException: The object of type 'QuestUI' 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.

GameCreator.Quests.UI.QuestUI.UpdateQuest () (at Assets/Plugins/GameCreator/Quests/Mono/UI/QuestUI.cs:197)

GameCreator.Quests.UI.QuestUI.OnQuestChange (System.String questID) (at Assets/Plugins/GameCreator/Quests/Mono/UI/QuestUI.cs:142)

GameCreator.Quests.QuestEvents.OnChange (System.String questID) (at Assets/Plugins/GameCreator/Quests/Mono/Utilities/QuestEvents.cs:38)

GameCreator.Quests.QuestEvents.OnTrack (System.String questID) (at Assets/Plugins/GameCreator/Quests/Mono/Utilities/QuestEvents.cs:92)

GameCreator.Quests.Quest.SetIsTracking (System.Boolean isTracking) (at Assets/Plugins/GameCreator/Quests/Mono/Classes/Quest.cs:23)

GameCreator.Quests.UI.QuestUI+<>c__DisplayClass42_0.b__0 (System.Boolean status) (at Assets/Plugins/GameCreator/Quests/Mono/UI/QuestUI.cs:263)

UnityEngine.Events.InvokableCall`1[T1].Invoke (T1 args0) (at <480508088aee40cab70818ff164a29d5>:0)

UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <480508088aee40cab70818ff164a29d5>:0)

UnityEngine.UI.Toggle.Set (System.Boolean value, System.Boolean sendCallback) (at C:/Program Files/Unity/Hub/Editor/2019.3.13f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Toggle.cs:280)

UnityEngine.UI.Toggle.set_isOn (System.Boolean value) (at C:/Program Files/Unity/Hub/Editor/2019.3.13f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Toggle.cs:243)

UnityEngine.UI.Toggle.InternalToggle () (at C:/Program Files/Unity/Hub/Editor/2019.3.13f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Toggle.cs:313)

UnityEngine.UI.Toggle.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/Program Files/Unity/Hub/Editor/2019.3.13f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Toggle.cs:324)

UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Unity/Hub/Editor/2019.3.13f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:50)

UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at C:/Program Files/Unity/Hub/Editor/2019.3.13f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:261)

UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Unity/Hub/Editor/2019.3.13f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)

Unity version:
2019.3.13
Game Creator version:
latest
Under review

This sounds like a bug. I'm opening a ticket and see if I can narrow down the problem. Could you post some screenshots/video of how the problem appears? In particular, the Actions you're using and the UI. It will allow us to see more easily where the problem is and fix it faster.

I'm not sure if this is going to work, but are you completing two quests in the same Action? If that's the case, could you try adding a Wait Action (of 0.1 seconds or so) between the two instructions that complete the quests?

Let me know if that fixes it.