Hello. I am starting to build the main menu of my game.
I want it to work like many of the classics, where various elements drop down when you hover the mouse at the top of the screen, like this: https://imgur.com/BpkltXm
I have a feeling I have approached it in the wrong way, but it is half working...
I am attempting to use the InGame menu like a hotspot:
I have set up the pre-existing 'InGame menu' so that the InGame 'MeunButton' is centred at the top of the screen with maximum width and the height is at around 5.1, so it covers the top strip of the screen.
I have set the 'Appear type' of the InGame menu to 'Mouse Over' and have created simple Action lists for 'Action list when turn on' and 'Action list when turn off', to turn the main parts of my menu (the 'menu options', 'objectives', 'inventory' and 'observations' menus as shown in the picture) on and off respectively.
Turning them on works fine - they turn on when I hover over the 'MenuButton'. But they don't turn off again when I move my mouse away. I think this is because I am thinking about it the wrong way.
What is the best way to approach buliding a menu like this? Any tips welcome.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Hi, sorry. I figured it out 2 minutes later. I've got it working. A stupid mistake. PLEASE DELETE
Mistakes happen. I'm sure others in the future with a similar situation would appreciate you sharing what was missing.
OK, can do:
For each of the menus that I wanted to switch on, I set their 'Appear type' to 'manual'.
Then, in the 'InGame' menu Action lists I used the 'Menu - change state' function to turn each of these menus on - in the 'Action list when turn on' -
and (crucially for me) when I copy pasted the functions into the 'Action list when turn off' it was important to switch the function so that it turned the menus off again.
It is also important to spell the name of the menu correctly as it appears in your menu list.
I'm trying to create a dropdown Unity UI inventory that just rolls down to its normal position from the top of the screen when you move your mouse there. It is similar to the image in the OP. The inventory is positioned at the top of the scene, I have the Appear type set as Mouse over, but that is where I got stuck.
Is there any setting in AC to make the menu literally smoothly drop/roll down? (not pop up, not fade). Or do I have to use the Custom Animation States? But in that case, how can I animate the menu so it rolls down with the currently collected items? Is there any feasible way to do this?
To have a Unity UI-based Menu pan down when turning on, you'll need to rely on an animation-based transition, yes.
Sorry, can you rephrase this? I'm not clear on your meaning.
Sorry for not being clear. Yes, I want the Inventory menu to pan down. The collected items show up in the inventory bar. So at each moment of the game, the bar looks different (you have various items currently collected). My idea is for the whole inventory bar with its current items to pan down when i move the mouse to the top of the screen.
I could make some animation for this, but it could only be something general, never with the currently collected items (a state that changes throughout the game).
So, is there a way to do this, preferably simply? :-)
Does it look different in a way other than just items being added to the item bar?
Panning up/down would be done with animation. You wouldn't affect the entire UI prefab - just a RectTransform that's a parent of what's visible. Move the parent, the rest will move with it.
No it looks the same, just with new items added. Thanks for the tip, i will try that!