Forum rules - please read before posting.

Menu manager sporadically loses Unity UI prefab link

edited May 2019 in Technical Q&A

I'm having a sporadically occuring issue with my custom Unity UI subtitles. Sometimes when running the game, the prefab goes missing and the subtitles won't show. I get the following log message:
The Menu 'SpeechbubblesUI' has its Source set to UnityUiPrefab, but no Linked Canvas can be found!

It seems like the menumanager loses its link to the UI prefab which resides in a Assets/gamename/UI, and I need to open the prefab, enable it and then drag it over to the menu manager again to make it work again. Is there a way to prevent the prefab from getting disabled? This is my first time with Unity UI, so it might be something I'm missing - but it's strange that it only happens from time to time. Can it have something to do with the enabling and disabling of UI prefabs in DontDestroyOnLoad?

Link to my Menu Manager settings (where the linked prefab has lost its connection) and the suddenly disabled Unity UI:

https://imgur.com/a/cpWckvN

Anyone have any hints of what to check, or if it's possible to force a prefab to stay enabled?

Edit: I'm on Unity 2018.3.7f1 and latest AC, building for Switch.

Comments

  • UI prefabs becoming disabled has been something of an annoyance - and it's something I'm trying to address - but it's never caused the Menu system to not work. Prefab references should still be retained, and scene-instances are enabled at runtime.

    Can you share the full error message above, including the stacktrace?

    So that we can try to isolate the problem, what effect does unchecking Duplicate for each line? have?

  • edited May 2019

    Here is the full message:
    `The Menu 'SpeechbubblesUI' has its Source set to UnityUiPrefab, but no Linked Canvas can be found!

         -> AC debug logger
        UnityEngine.Debug:LogWarning(Object, Object)
        AC.ACDebug:LogWarning(Object, Object) (at Assets/AdventureCreator/Scripts/Static/ACDebug.cs:25)
        AC.Menu:LoadUnityUI() (at Assets/AdventureCreator/Scripts/Menu/Menu classes/Menu.cs:398)
        AC.PlayerMenus:AssignSpeechToMenu(Speech) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:2371)
        AC.Dialog:StartDialog(Char, String, Boolean, Int32, Boolean, Boolean) (at Assets/AdventureCreator/Scripts/Speech/Dialog.cs:155)
        AC.ActionSpeech:StartSpeech() (at Assets/AdventureCreator/Scripts/Actions/ActionSpeech.cs:689)
        AC.ActionSpeech:Run() (at Assets/AdventureCreator/Scripts/Actions/ActionSpeech.cs:151)
        AC.<RunAction>d__33:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:364)
        UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
        AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:314)
        AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:546)
        AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:464)
        AC.<RunAction>d__33:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:433)
        UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
        AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:314)
        AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:546)
        AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:464)
        AC.<RunAction>d__33:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:433)
        UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
        AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:314)
        AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:546)
        AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:464)
        AC.<RunAction>d__33:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:433)
        UnityEngine.MonoBehaviour:StartCoroutine(String, Object)
        AC.ActionList:ProcessAction(Int32) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:314)
        AC.ActionList:ProcessActionEnd(ActionEnd, Int32, Boolean) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:546)
        AC.ActionList:EndAction(Action) (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:464)
        AC.<RunAction>d__33:MoveNext() (at Assets/AdventureCreator/Scripts/ActionList/ActionList.cs:433)
        UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
    

    `

    I will try unchecking the Duplicate... checkbox and see if it makes a difference and report back!

    EDIT: The duplicate function when disabled makes formatting weird in my speech bubbles (only one character width, so super tall) :)

  • The duplicate function when disabled makes formatting weird in my speech bubbles (only one character width, so super tall)

    Aside from that, does the original error appear?

    The disabling of duplicate Subtitle UI prefabs will be addressed in the next update. PM me if you'd like to be involved in beta testing.

  • I haven't been able to reproduce the bug when Duplicate... is turned off, but I'll try some more and see if it reappears. However, this prevents my text boxes to scale properly. Will report back if I see any more errors.

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.