Forum rules - please read before posting.

Inventory Problem resize and appearing issue

edited January 11 in Technical Q&A

Hi everyone

Unity version 2022.3.4f1
Ac version 1.79.2

We have 3 small problems with inventory. I have recorded a video, please watch it here. Also uploaded Inventory Properties image in here.

1-When I move my mouse on top of screen to bring Inventory, it only affect the center top area (size of the inventory) to show up. How can I make whole area of top screen to show Inventory?

2-Also the small gap between Inventory and top of screen, will cause the Inventory to go back and forth.

3-And the Inventory size and its items will change in different aspect ratios. (I have looked forum topics but couldn't get anywhere since I don't want to change default Source to Unity UI prefab etc, it messes with other things). Also Automatic option didn't fix it.

If you watch the video and properties image would be more clear.
Thanks for your time :smile:

Comments

  • When I move my mouse on top of screen to bring Inventory, it only affect the center top area (size of the inventory) to show up. How can I make whole area of top screen to show Inventory?

    Also the small gap between Inventory and top of screen, will cause the Inventory to go back and forth.

    A Menu of appear type "Mouse Over" will only show when the mouse is over it.

    Switching to Unity UI will make this easier because you can expand the RectTransform boundary without affecting the appearance of the elements within it.

    With AC Source, though, you can create an invisible "dummy" menu that is set to Mouse Over instead - setting the appear type of the Inventory menu instead to Manual. Then, as part of the dummy menu's "ActionList when turn on/off" Actions, use the Menu: Change state Action to turn the Inventory on/off.

    And the Inventory size and its items will change in different aspect ratios.

    You'll need to rely on Unity UI for this - it offers much greater control when it comes to how its appearance varies with screen size.

    If you're having issues switching over, share details and I can help.

  • Thank you so much for the fast reply <3
    So I should go for unity ui, the problem is when I change it to unity ui nothing work, I mean even I can't move my character, it's kind of like clicking doesn't work.
    But I will go through it more precisely and will ask questions, thank you thank you :)

  • Ok I didn't expect changing to Unity UI Prefab could be easy using provided Inventory Prefab (provided by AC), thanks for that :)

    Just some other tweaks, is it possible to have these two options?

    -whenever an item goes to inv, we want to have an animation (open inventory, having an animation for the item like make it big and small to place it in its slot). (like placing the item into its slot to feel better)

    -when selecting an inv item, make it bigger and also turn its alpha a little lower, and once it is reached to a hotspot, turn back the alpha to normal.

    You can watch similar effect in this game.

    Already there are default highlighting and second Active graphic which is cool though. I was just curious if there is work around for these as well. or we have to use scripting?

    Everything else mentioned at previous post are fixed now, thank you so much Chris!

  • They're both possible - but they're a bit involved so it's best to take things step by step.

    whenever an item goes to inv, we want to have an animation (open inventory, having an animation for the item like make it big and small to place it in its slot). (like placing the item into its slot to feel better)

    With Unity UI, you can now make use of Unity's animation tools to handle this.

    Attach an Animator to the item slot's Image component, and create an "empy" animation, as well as one that changes its Scale as desired. Then create Transitions to/from the two animations - with "empty -> effect" requiring a Trigger parameter, and "effect -> empty" kicking in automatically with its Exit Time.

    You can then copy the Animator component onto each of your other slots, so that each has its own.

    A little scripting might be needed next, so let's get the above sorted first. You can test it out at runtime by checking the Trigger parameter box in the Animator at runtime.

    when selecting an inv item, make it bigger and also turn its alpha a little lower, and once it is reached to a hotspot, turn back the alpha to normal.

    For this, you'll want to make use of "Unity UI" for your Cursor rendering, as this allows you to control its appearance with another Animator.

    See the Manual's "Unity UI Cursor rendering" for details. Start by switching over to this mode, so that the cursor appears as it was before. Then, add an Animator that has a "InventoryID" Int parameter referenced by the Unity UI cursor component. This will be set to the ID number of the currently-selected item. Check that this updates correctly at runtime, and we'll take things from there.

  • Hi
    Thanks for this suggestion, it worked somehow (changing parameter manually) but for the little script, I couldn't do it (lack of coding skills), although it should be simple. But since we could have it one-time only (for inv introduction), we did it with another trick for now, so later with the script we can have it anytime for any item. All goood for now, Thaanks Chris :)

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.