Forum rules - please read before posting.

UnityUI subtitle menu with 'Duplicate for each line' not shown in build after restart the game

Hello.
There is 5-6 UnityUI Prefub menus in my game.
Two of it has 'Duplicate for each line' option enabled.
After first game start all works as expected but if I restart game via menu without restart application both menus with 'Duplicate for each line' option stop working (only affect to game build. In Editor all works well after restart)
I created development build and find this it logs:

The Menu 'PlayerSubtitles' has its Source set to UnityUiPrefab, but no Linked Canvas can be found!

All my canvases without 'Duplicate..' option spawns while scene start in DontDestroyOnLoad, but subtitles menu spawns for each dialog line and desapere after line ends.

If I disable 'Duplicate..' option subtitles menu works well after restart the game.

I "fixed" it with comments in ./Scripts/Menu/Menu classes/Menu.cs

        public bool GetsDuplicated ()
        {
            //if (oneMenuPerSpeech)
            //{
            //  return (appearType == AppearType.WhenSpeechPlays);
            //}
            return false;
        }

Now all my canvases spawns while scene loads in DontDestroyOnLoad and additionaly Subtitle canvas spawns for each line.

I'm not getting problems with subtitles after this "fix"
Is it may lead to problems in future?

Comments

  • There is 5-6 UnityUI Prefub menus in my game. Two of it has 'Duplicate for each line' option enabled.

    Sorry, but I don't follow what you mean here. You have two subtitle menus? What are their properties, exactly?

    Please also be sure to state your AC and Unity version numbers when posting. As this only affects builds, please also state the platform you are actually building to.

    but subtitles menu spawns for each dialog line and desapere after line ends.

    Isn't this correct behaviour? A subtitle menu should spawn for each dialogue line, and disappear after the line ends.

    Please give steps to recreate the problem, so that I can see it for myself.

  • edited March 2019

    Thank you Chris and sorry for not informative post
    I'll do my best.
    AC 1.66.8
    Unity 2018.3.8f1
    We work with Windows Builds now.

    I was able to reproduce the problem it test project so I think simplest way - give you a sample.

    There is a project
    (REDACTED)

    And this is a Windows build (issue reprodused only in build)
    https://drive.google.com/open?id=1QBQ6Dnj-XyY2fjQvhT6qo7PbEzjKbrWB

    Short demo video

    While I trying reproduce this problem I found that game restart doing via Engine -> End game -> Restart Game with "Reset Menus too" option selected. Looks like while "Reset Menus too" option is not selected this problem not reprodused too.

    Now I can't decide what is the best way - uncheck this option or left comments in Menu.cs :)

  • edited March 2019

    I've removed your link.

    AC is a commercial project - you MUST NOT post public links to it on the forum, see the forum rules.

    Reset your Menus via the option - it's there to help you avoid having to modify the source code.

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.