I'm making a Game right now, I have a problem with the main menu. When I press ESC, the menu opens and the time freezes. The cursor is then visible. But I can still look around, while the menu is on the screen. And if I click a button, for example the resume button, nothing happens.
If the buttons don't do anything, make sure to asign a task for each button, for example, if you want to pause the game when the player press the pause button, make sure that the pause button has the task of pausing the game asigned to it.
I think that your problem is with the Event System of your scene, the Canvas needs an event system to work properly, if you delete it or change something in the event system, the Canvas will not work.
The Event System is created automatically when you add a canvas into your scene, make sure it looks like that:
Related
I'm looking for a way to first off detect when the left click is being held down (MouseDown event, but not just inside the form), then after a delay of, let's say, 1 millisecond, disable all the function of left mouse button.
Put in another way, effectively make holding the button function like a one-millisecond click.
Also I want this to run at all times while the program is open, not just in the form itself but universally everywhere throughout all other programs, desktop, you name it.
Hi i am making a card inventory where i have 4 selected cards and a grid of cards to select from. when pressing a card i have a button that popps up that you can press to select the card, but my problem is that i have no clue how to make that button go away.
i want to have a select button show up when pressing a card, and pressing another will make it go away, or pressing anything else will make it go away. but i have no clue how to.
the dropdown ui template ha this built inn, when clicking the dropdown the options show up, when clicking anything else it goes away, i want that.
edit: for further clarification, i have 2 buttons, 1 makes the other one visable, the other one is going to go away when clicking anything else than the button itself. that is all i have
any idea random wonderful strangers on the internett
love
As I misunderstood your problem the first time, I'll write it the second time.
I think this is really simple to solve, so basically create a huge and transparent button which will detect all of the clicks besides from the cards and buttons.
So my solution is:
Create a button called for example "Background" and set its scale to an enormous values like 1000 to cover the whole screen all time.
Set all of the button's colors (Normal Color, Highlighted, Pressed, etc.) to transparent - basically set the Alpha value to 0
The button has to be above all of the other buttons in the Hierarchy of Canvas (or however you called it) in order to work as a background and not cover up other buttons.
Detect the clicks on the "Background", which will just hide the "Select" and the "Info" button.
I hope this time it will work.
I have a problem which makes me crazy. I have created a scroll rect in unity with a lot of Input Field's like in picture below.
My problem is : I can't scroll!!! Every time when I try, the keyboard it's opened. Scroll it's able just if I hit the red space between the Input field's.
I am thinking that the problem is because the keyboard appears on OnPointerDown and not OnPointerUp or OnPointerClick. I tried to add a EventTrigger component to InputField and add actions for OnPointerDown and OnPointerUp but I had no success to change keyboard behavior.
Any help? Any ideas? Please! Thanks a lot!
You can create Button and attach InputField as child of it, then:
add button OnClick event InputField.Select()
Disable Raycast Target for InputField, Placeholder and Text
To hide button you can make it transparent.
As I am working on screentime, I would like to block the screen after the user's allowed time gets over. My screen will be on the top after allowed time gets over.
In Microsoft family safety screentime even if the user presses windows button, start menu will appear behind the microsoft's blocking screen. I dont know how to do the same. They've not blocked any inputs. Whatever the user does will happen behind the screen.
In my app user cannot switch to another screen. I put window.topmost = true
in both OnLostFocus event and Deactivated event.
Everything is working fine except the start menu case.
What is actually happening when start menu appears, which event is taking place? How can I override it?
I am trying to make buttons seem like pressed automatically so the user can then follow the buttons pressed but everytime I try it doesn't seem natural because the computer does it really fast all the changes!
Any ideas? I have to get a serious of buttons pressed that look like user pressed and then pass to unpressed again
Thanks a lot!!!!
Well I'm trying to make a game where you remember the buttons that were randomly selected by the computer and then you press them, so I need computer to act like if the user were touching them and then the user follows...
How about using a custom storyboard animation that takes the button to the pressed, and then unpressed state?