Forum rules - please read before posting.

Menu element crossfade disables Unity UI in scene

Unity 2021.1.0f1 AC 1.73.3

My pause menu, a modified version of the Unity UI prefab included in AC, has an Options menu element that crossfades to the menu of the same name (again, a lightly modified version of the AC Unity UI prefab).

When I select options from the pause menu in a scene that has Unity UI in Scene elements, these game objects disappear; looking in the editor, they've been disabled.

Similar bug to the error I had in this thread https://adventurecreator.org/forum/discussion/11124/unity-ui-in-scene-disabled-by-ac-on-scene-switch#latest in which Unity Ui in Scene game objects were being disabled on a scene change?

Comments

  • edited April 2

    Similar bug to the error I had in this thread

    Shouldn't be - that specific issue was addressed in v1.73.1.

    looking in the editor, they've been disabled.

    That is, disabled in the Hierarchy?

    It sounds like there's a conflict with your Constant IDs, though these should be relegated to just within each menu.

    How many "Unity UI In Scene" menus do you have in such a scene? Presumably, disabling them all while in Edit mode, saving the scene and then running the game, prevents the issue. Assuming so, try re-enabling them in turn to see which one causes the issue.

    Try to narrow down which in-scene menu is causing the conflict. Then, have a look within that menu to see if any of it's objects share the same Constant ID value as the Option menu's element(s) that are being disabled.

  • Yep - disabled in the hierarchy is indeed what I mean.

    Some more info:

    The same bug occurs on another scene in which I'm using Unity UI in Scene - it's the title screen, so I usually have the pause menu locked, but if I unlock it here, the same thing occurs: Selecting options cause the Unity UI in scene to be disabled in the hierarchy.

    In the case of the original scene I was referring to in my first post, there are three menus in this scene, two of them child objects of the first. Disabling any one of these does not stop the error occurring (although disabling the parent makes all of them disappear ofc, that's what the bug is doing!).

    None of the objects in any of the Unity UI in Scene stuff have the same Constant ID as any of the Options Menu elements - I check in the title screen too, and this is also the case there.

  • In the case of the original scene I was referring to in my first post, there are three menus in this scene, two of them child objects of the first.

    Menus are not intended to be nested. If you want to create the appearance of sub-menus, store all your elements within a single Menu and use Animation to change which group of them are shown at once.

  • The menu nesting might be the cause, I'll look into it, and report back - but it's weird that other than this error, the nested menus work just fine, and the title screen doesn't have any nested menus, but still has this error.

  • the title screen doesn't have any nested menus, but still has this error.

    If you can prepare a .unitypackage file that includes the Managers, prefabs and scene assets necessary to reproduce the error, PM it to me and I'll take a look.

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.