Questions tagged [unity-ui]
Unity UI is a UI toolkit for developing user interfaces for games and applications in Unity. It is a GameObject-based system that uses Components and the Game View to arrange, position, and style user interfaces.
222 questions
0
votes
1
answer
3k
views
DOTween capacity always increasing
I'm creating a sequence and adding a couple of tweens to it. If I call it a couple of times the tweens capacity gets increased exponentially till everything gets incredible laggy.
I've recorded this ...
0
votes
1
answer
127
views
how does unity handle image scaling
Unlike in android SDKs, in almost all tutorials I've seen, creating UI elements like menus in unity starts with laying out a default background image onto a canvas object.
I don't really get the fact ...
0
votes
4
answers
2k
views
Interacting with UI with a locked cursor?
It seems like Unity has disabled UI interaction while the cursor is locked, which is frustrating because the store in my game is an actual in-world one, and thus means the player has to look at the ...
0
votes
2
answers
5k
views
What's the best way to draw gizmos in build
I currently use Unity gizmos for many debugging purposes, but I'd like almost all of them to be visible to the player in-game (when the game is built).
For example, when a player is dragging to place ...
0
votes
1
answer
1k
views
Identify when Unity Button Enters Pressed State
I am trying to create a UI Button Prefab with a text child element that I would like to use all over my application. Its intended behavior is very simple:
Its size would be dependent on the text's ...
0
votes
1
answer
203
views
Updating settings UI from script also triggers method to update settings from UI interaction
My application has a UI for settings which is a mixture of textboxes and scrollbars with which users can interact. I have created a class for these settings and create an object to store them. The ...
1
vote
1
answer
259
views
Unity UI - Make text come out and go back in
In Unity UI I have a TextMeshPro Button and some TextMeshPro Text like in the following image:
Is there any function in a Tween Library like DOTween that could make the text look like its coming out ...
0
votes
1
answer
1k
views
How do I set the opacity of a Button to 0? (Unity)
I'm trying to hide a button when you click that button (I meant setting the opacity to 0, not disabling the game object of the button). What the button does is it loads a scene async. If I disable the ...
0
votes
1
answer
2k
views
Starting a Coroutine after another Coroutine ends
I have a method that fades the screen to black, then fades away back again using coroutines but I couldn't get the 2nd part to work.
FadeToBlack() works if I put <...
0
votes
1
answer
96
views
How to make prefabs UI work on any canvas scaller?
I want to make my UI prefab working on all size of canvas reference resolution scaler because I already make one which is not prefab UI its work to all reference resolution but when I make it prefab ...
1
vote
0
answers
3k
views
Orientation changed event in Unity3D?
I'd like to listen to orientation change events, so for example my UI layout or the components themselves can be changed.
All I've found is that I should check the value of ...
0
votes
0
answers
634
views
What is the difference between WaitForSecondsRealtime and a counter?
I am making my own button using the Unity UI code, but now I got to the OnFinishSubmit () coroutine
...
0
votes
1
answer
597
views
UNITY: How to LOAD save file from main menu
So I've created a simple main menu with a new game, load game, and quit game buttons. In the new scene where I've created pause menu save/load buttons work, I've created a new object and attached a ...
0
votes
1
answer
76
views
Non-invocable memeber 'Text.text' can not be used as a method [closed]
Trying to change text in a text box, and have multiple lines on it, i found something online talking about "\n" but this came up.
Non-invocable memeber 'Text.text' can not be used as a ...
0
votes
1
answer
1k
views
How to get a specific button component
I'd like Unity to get a specific button with:
GetComponent<Button>().interactable
But how do I get a specific button with a name?
0
votes
2
answers
2k
views
Strategy for temporarily blocking user input
What are good approaches for disabling user input during certain moments in a game?
In my case, I have a grid-based tactics game (kind of like Fire Emblem) where I periodically want to toggle the user'...
0
votes
1
answer
6k
views
Unity UI Buttons Not Functioning
I have been working on a UI Inventory System for my Unity game and for some reason, none of my buttons work in my game. All the buttons have the ‘interact-able’ box ticked and an EventSystem which is ...
1
vote
1
answer
4k
views
Unity: How to get the visible bounds of an object, i.e. as it is seen from the camera?
Imagine you'd like to highlight a 3D GameObject by drawing a (translucent) UI panel above it. The UI panel should cover the object exactly. Therefore the object's bounds, as it is seen from the camera,...
1
vote
1
answer
2k
views
Difference between methods - onClick.AddListener and On Click under UI button inspector?
Within my Unity Project in my code, (see below), I have a button called Check which executes when CheckPress() function is called. I read two approaches by which this can be done.
Appraoch 1: Using <...
1
vote
1
answer
2k
views
How to instantiate a prefab at mouse location in the editor in unity?
I want to instantiate a prefab at the mouse position in the editor. All the answers I found till now are for instatiate a prefab at runtime but i want to instantiate in the editor.
Currently I am ...
1
vote
1
answer
478
views
What is the Unity 2019.3.5 version of `UnityEngine.UI.Text`?
I was following a tutorial on how to create a dialogue Box in Unity, and in one part of the tutorial the tutor imports UnityEngine.UI and creates an object of type <...
0
votes
0
answers
352
views
How can I make a health bar — a UI element — part of a character prefab?
Description
I want my character prefabs to come with their own health bar, but I can't simply add one as part of the prefab, because it's a UI element and therefore goes into a Canvas.
Potential ...
1
vote
0
answers
293
views
Unable to wire UI Text object to C# Script
I have created UI text object
And then created Text field in behavior class:
...
0
votes
1
answer
362
views
Gradient Input in Game view
I want to develop a little tool to help visualize fireworks before using them in a show in Unity where the user can set several parameters and gets a preview of the firework effect in a preview window....
0
votes
1
answer
719
views
Working with Screen Space - Overlay canvases
So, say you've started a new project. You drop your in desired sprite. You can see how big it is relative to the Main Camera. That's cool.
Now you want to add a persistent bit of UI to the game, so ...