Forum rules - please read before posting.

Toggle Menu on Mouse scroll down/up

I've been fiddling around with custom scripts and searching the forum/wiki for an answer to this. I want to toggle the inventory with the mouse scroll. Preferably I'd want the inventory animated to slide down as well and then slide up.

What would be the best way to achieve this?

Comments

  • Ok so I got the menu show and close to work.

    But how should I go about the animation? Do I need to switch it to a UIMenu perhaps?

  • You're talking about animating the positions of the elements themselves?

    Yes, switch to Unity UI - this tutorial covers the process.

    With Unity UI, you can attach an Animator component to control the position of the various elements - AC won't control their position, meaning they're free to be set by Unity's animation system.

  • OK I'll check that out. Thanks a bunch!

    For clarification I want the inventory to slide down when I scroll down and then slide up when I scroll up. If that makes sense! :)

  • If you're just looking to "shift" element slots (non-animated), you can call the element's Shift function - which equivalent to using a Button element set to "Offset Element Slot".

    If it's a case of keeping each slot mapped to the same item, and moving those slots to reveal/hide them, then it's more a case of dealing with Unity UI Scroll Rects and other components - not so much on the AC side of things.

  • Ah I feel stupid now. The functionality was already built in. By using pan from top I got the desired effect. Thanks for the support!

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.