Forum rules - please read before posting.

Hiding Menu Elements not working

Hi all,

I created an AC menu linked to a unity prefab that I'm hoping to toggle visibility on based on button clicks. It seems like the action list is running (just debugged it by making the player say something), but the issue is that the object: visibility actions are not running.

For reference, I do have a "remember visibility" component on each of the root-level components I want to hide and show, and each of these "root-level" components have children and grandchildren.

However, I have not linked all the elements to AC elements, because it seems that I cannot link scrollbars to AC elements when I'm connecting the menu to a Unity Prefab.

Just a small video of the video and action list: https://drive.google.com/file/d/1dLjiwb63Zw3m3CfiGq1lStvKsVb3Rebr/view?usp=share_link

Is there something I might be missing? Thank you!

Comments

  • To hide/show menu elements, use the Menu: Change state Action, not Object: Visibility.

  • Oh thank you so much! Would this work for non-linked elements as well though, that are part of my menu?

  • No, only elements linked via the Menu Manager.

    To control the enabled-state of non-linked elements, you can either use the Object: Call event Action, or control their state using animation and the Object: Animate Action.

  • edited January 2023

    Ah got it, thank you! Just wondering though -- is it possible to link scrollbars?
    I tried doing this, but it seems like I get the following message in the editor:

    https://drive.google.com/file/d/1KVF6MkC-eFOJofmH7mpNjYN76Gjr2G37/view?usp=share_link

    Also -- does hiding menu elements support multiple layers of children if I select "affect children"? Just wondering before I switch up some of my actionlists :)

  • is it possible to link scrollbars?

    No, but it's not typically necessary, since a scrollbar's functionality is buit-in to Unity and not something AC needs to modify.

    Also -- does hiding menu elements support multiple layers of children if I select "affect children"?

    Elements do not have a concept of children. If you want to disable a hierarchy of GameObjects, use the alternative Actions I mentioned above.

  • Got it, thanks!!

  • Would someone mind explaining this a bit more? I have a UI Canvas structure like this,

    Canvas
    ↳Panel
    --↳ Image A
    -----↳ Children
    --↳ Image B
    -----↳ Children

    and I’m trying to control the visibility of Image A and Image B (including all their children) using Object: Call event. What’s the best way to set this up, especially since they’re part of a UI prefab and the images aren’t linked directly as Menu Elements?

  • Object: Call event won't update its connection to the instance of your UI in the scene - it'll only ever affect the original prefab.

    Instead, you can use Object: Animate, and set up an Animator on your Canvas with animations that show/hide your Image objects (separate layers, so that they can be set independently).

  • Thanks so much for the quick response, you totally saved me! I also really appreciate you pointing out the part about separating layers. It works perfectly now.

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.