Forum rules - please read before posting.

Tutorial UI issues

edited June 2022 in Technical Q&A

Using the latest version of both Unity and AC as of now.
I have followed every step of the recreate tutorial
But it's not until UI that I'm having huge issues with it, the inventory won't work, the text simply won't appear below except for subtitles and the items don't even show up here. Help?

Here's an image
https://ibb.co/dcNScHD
Imgur wont work so using another one btw

Comments

  • edited June 2022

    Welcome to the community, @RogueFan012A.

    Is this before making any changes to the default interface? If you opted to work with Unity UI in the New Game Wizard, then Inventory items should be showing up otherwise.

    The default UI works by spawning canvas prefabs into the scene. First off, make sure the default InventoryUI prefab is not in the scene file itself - it'll need to be spawned in automatically.

    Unity UI does add another layer of complexity to things. Each of the menus that make up the default interface can work both with and without it, via the Source field in their properties. If you go to the Menu Manager, select your Inventory menu, and temporarily change this field to Adventure Creator, do items then show?

    Setting it back to Unity Ui Prefab, Unity UI components are linked to AC menu elements by Constant ID numbers. If you select the InventoryBox element underneath the Inventory menu's properties, each of the slots should note a Constant ID value - these should match up with the Constant ID components on the InventoryUI prefab assigned in the Linked Canvas prefab field of the Menu. The Console window should report any time an element cannot find its expected UI object.

    A tutorial detailing my meaning can be found here. Though, since the tutorial eventually deals with the creation of a new Inventory menu anyway, you may prefer to switch the default menu's Source to Adventure Creator in the meantime.

    You're welcome to share any screenshots of your Hierarchy and Menu Manager if you'd like another set of eyes on them.

  • Thanks for the welcome!

    Oh no, this is after making changes, in truth I did finish like 80% of that section BUT I did change source to AC, which makes it work when it comes to showing the items but the default inventory is still showing.

    https://ibb.co/KLc3srM
    https://ibb.co/Lr73n8W

    I am definitely not sure what's going on here, I found another thing, despite following every step, the glasses model won't show at all, it works for the guard but it won't update the disguise.

  • The "Persistent" scene is part of the original Unity-made demo game, and is used to handle logic that persists throughout the game.

    AC has its own equivalents of its SceneController, BackgroundMusic, EventSystem etc object/components - this scene is not necessary and will cause conflicts if loaded at the same time as AC.

    The InventoryUINew prefab, once linked to the Menu Manager, will be spawned in at runtime - it shouldn't be present any saved scene file. If it is, you'll get duplicates - since AC will spawn in a copy, with the original there in the scene as well.

    the glasses model won't show at all

    There's a couple of approaches you can take here, but the tutorial does this by using the Object: Visibility Action to show a Mesh Renderer that's attached to the Player's prefab (the "Disguise" object parented to the Head).

    At runtime, this Action will need to affect the spawned scene instance of this object - not the original prefab itself. In order to do this, AC automatically assigns and records a "Constant ID" number both on the object, and in the Action. You should find a "Constant ID" component is attachched to the Disguide object, and the number displayed there is also listed in the Action. This link is what allows the Action to affect the scene-instance at runtime. Are these ID values present, and matching?

    For completeness: the other approach that could be taken would be to create a sub-layer in the Player's Animator Controller, and use a pair of AnimationClips + a Bool parameter to control the Disguise object's visibility instead. Visibility could then be controlled by using the Character: Animate Action to set that bool parameter's value.

  • Thank you so much, not only was the wrong ID linked, but I had persistent doing things so once that was solved, UI was fully solved.

    Now about the model, really, the Disguise interactions seem to be my bane here.
    https://ibb.co/N9B78QM
    I did try to solve it like in the video but nothing worked, I'll try your other solution sure, but now, this is the default state of the bird interaction, I double-checked to make sure I had no mistakes here and I didn't, I really don't know so I'll leave it like that and move on to the other 3D tutorial instead.
    Nonetheless, thanks a lot.

  • this is the default state of the bird interaction

    To be clear: is the issue to do with the bird not showing, and the glasses on the floor, by default - or with the glasses not showing on the Player character's head when taken? The advice I was giving was in the case of the latter.

    The bird's presence is driven by the state of the "BirdGlassesCutscene" object/Animator, which should have its default animation state as "Idle".

    The transition to the "FlyAway" animation, which causes the bird to hide and the glasses to fall, should require a Trigger parameter FlyAway. Check the Animator Controller's default state, and keep its window open when the scene begins to check if it's transitioning to this FlyAway state at the wrong time.

  • edited July 2022

    Sadly I lost this tutorial file so I am not able to update on what happened, I'll do it again later.

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.