Forum rules - please read before posting.

Unity UI Prefab doesn't keep the linked elements

I know this has been mentioned already in the forum but I still cannot process how this is happening.

A few months ago I was able to link elements on the Unity UI menus just fine, but now they disappear whenever I press play on the project or even when i get out of the Prefab.

My version is 1.72.4

Comments

  • What is your Unity version, and are you referring to the object names being listed in the Menu Manager?

    Unity cannot retain such links when a prefab is closed - but AC gets around this by way of its Constant ID system.

    When you drag e.g. a Unity Button into an AC Button element's "Linked Button" field, AC attaches a Constant ID component to the Button object, and display its value under the field in the Menu Manager. At runtime, AC then re-connects these two using this ID number.

    If this fails, you should be getting a warning about it in the Console. Are you getting this warning, and does the Constant ID component on a typical object match that listed in the element's properties in the Menu Manager?

    If you can share screenshots of the objects involved, I can try to spot the issue.

  • Hi Chris, my Unity version is 2019.4.8

    I don't get such warning but the menu in the AC game editor still unlinks the asset anytime I press play or change scene.

    Here's a before and after of the menu system while I press play.

    https://drive.google.com/file/d/1xsSx3--p3xE1ceCweUjNfcTvQJdLXH93/view?usp=sharing

    https://drive.google.com/file/d/1GXx-FNmVxQ0lZ54Fq2T-GyZdHvUtaSiL/view?usp=sharing

  • Your first image is private - can you make it public?

    I'll also need to see the linked object that has the Image attached.

    Despite the Menu Manager unlinking, what effect does it have on the menu at runtime? Is the rest of the menu working as intended?

    No Image is defined in the Graphic element's properties - if things did link, it still wouldn't show any image sprite. What is the effect of assigning a texture in the element's Texture field?

  • The menu works properly, meaning that as if, for example, i make a unity ui for the subtittles, and the text is unlinked, then during the runtime it would just show an empty box where i have to click until it's over.

    sorry for the image privacy, i think it should be fixed by now.

  • As the Menus in the the Menu Manager don't represent the "live instance" of the menus, their appearance at runtime shouldn't be a factor in things. The same change in fields can be seen with the 3D Demo's Menus, which all have UI counterparts.

    Again, I'll need to see the linked object that has the Image attached. Please also share the properties of the Menu itself, and the "Linked Canvas Prefab" it references.

    for example, i make a unity ui for the subtittles

    The Menu in your screenshots is for a Diary. Is the behaviour for this the same, i.e. it turns on at the correct time, but the elements are unlinked?

    Please check the Console for any related messages.

  • yes, it was an example, no relation to the diary.

    Checking console did bring up this explanation that I added in the following screenshot:

    https://drive.google.com/file/d/15nY_qO8tg8CbpWD_cS4BBhvVc8lx8Jee/view?usp=sharing

  • I suspect that's unrelated - be sure to exit Prefab Mode before running the scene.

    Check for anything else, and please share the images I'm asking for above.

  • I need to see the Inspector of the linked GameObject.

    If you can create a .unitypackage of your Menu Manager and the DiaryCanvas prefab, PM it to me and I will take a look.

  • Sure, just sent you the package

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.