Forum rules - please read before posting.

Show/hide inventory via Mouse Wheel Up/Down

Hello community,

I'm a little stuck. After using the AC placeholder inventory for a long time I wanted to recreate an inventory style I find pretty intuitive. I want the inventory to appear when I use mouse wheel up and close it by using mouse wheel down.
And thats more or less where I get lost.
I know how to create the input, but it doesn't seem to work.

In the AC Menu Manager I call via "Appear type: on Input Key" and my set input "Mouse ScrollWheel".
Doesn't do anything.

I think I'm missing something here. Any ideas?

Greetings
Ptoe

Unity 2021 3.3f1 | AC 1.75

Comments

  • edited April 2023

    This is how my input is setup, btw. https://im.ge/i/LMCct4

  • edited April 2023

    "On Input Key" refers to a single button press - not an axis where the direction needs to be factored in.

    Instead, set the Appear type to Manual, and rely on Active Inputs to turn the Menu on and off.

    Active Inputs offer more control over what happens when input is detected. Details can be found in the Manual's "Active Inputs" chapter, but you can access them by choosing "Adventure Creator -> Editors -> Active Inputs Editor" from the top toolbar.

    You'll need to create two separate Active Inputs - one for turning it on, one for turning it off. Set both Input button fields to Mouse ScrollWheel, Input type to Axis, but set the "turn off" input's Axis threshold to the negative of the "turn on" (so that you have e.g. 0.1, -0.1 respectively).

    The ActionLists you then assign will run when the scrollwheel moves up and down. You can place Menu: Change state Actions inside here to turn the Menu on and off.

  • It works! Wonderful! Thanks a lot, Chris.
    I never used Active Inputs until now. If I had known about them I'd consulted the manual. I simply didn't find anything for mousewheel inputs.

    Info for anyone else:

    Tweak your gravity; sensitivity and dead values in the input manager. Before I did it simply didn't recocnise my input, though everything was set up correctly.

  • @ChrisIceBox

    Sorry, but now I ran into a follow-up question. I checked the forum but nothing seems to apply to my problem.

    I thought it would be easy to do, but I was wrong (again). I wish my inventory to also close, when I have an item selected and the cursor moves outside of the inventory. I think it would be inconvenient for the player otherwise.
    Is there something like a button/hotspot that when hovered over (with a selected item) calls an actionlist?

  • This could be done with scripting, but you should be able to get this behaviour by having a separate, invisible menu, that spans the area of the Inventory menu, and is set to appear "On Mouse Over".

    What you can then do is assign its "ActionList when turn off" to an asset that has an Inventory: Check Action (to check if an item selected), and follows it up with a Menu: Change state Action to turn the Inventory menu off.

    Try this with a visible Menu first, but make sure that Ignore cursor clicks? is checked so that it doesn't interfere with the Inventory menu's interactivity.

  • Either I didn't understand or my description wasn't precise enough. I want the inventory to close when the cursor goes outside of the borders of the inventory, but only when any item is selected und ready to be combined. Not one specific.

    I wasn't able to recreate it that way, but nevertheless I created said invisible menu and created an asset with "inventory: check select". I did it the other way around, meaning it checks if none are selected. If true it does nothing, if it is false, it shuts the inventory.
    Till now it's doing great. Thanks for the notch(es) in the right direction.

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.