Forum rules - please read before posting.

Custom Menu: text replacement not working

I have created a canvas with a panel and a legacy text element inside. These are shown correctly on the screen, however, regardless of whether using the label type "Global Variable" or "Normal" - the default text from inside that UI text element is never overwritten with the variable value or the custom text.

https://imgur.com/a/Id1Lyyd

https://imgur.com/a/LduUq2A

Still the text "New Text" is shown. I found the somewhat outdated tutorial here (https://adventurecreator.org/tutorials/displaying-game-score) - well it probably still works, but it doesn't explain how to do that using Unity UI instead of AC.

I don't know what I'm doing wrong here. I'm just using this because unfortunately the inventory still does not support showing the total count of an item, i.e. I have 40 and want to show the user how many he already has picked up and how many are available in total. So I have to rebuild an inventory type display here just to display that information.

Comments

  • Check the Constant ID component on the Score-Eggs object - make sure its value matches with that in the Menu Manager, 18838.

    If it does, and the UI is being spawned into the scene by AC (and not left in the scene file itself), it should connect. Check the Console window if not, and share images of how things appear in-game.

    I'm just using this because unfortunately the inventory still does not support showing the total count of an item

    The default InventoryUI prefab should indeed show item counts - each UI Button that represents the item slot has a Text child that should be set to the count automatically.

  • Thanks, Chris, I will check and provide that info later.
    Regarding the inventory I'm talking about a display like "12/20" which means the user has picked up 12 of 20. I only found the info here in the forum that the "/20" is not available.

  • Thanks for clarifying.

    In that case, it's probably best to allow for custom styling through events. I'll see if such a feature can be added - you raise a good point.

  • Ah, thanks, Chris! I not only created the Canvas asset, I also added it to the scene. That was the error. After removing it it works! 👍

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.