Skip to main content

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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
3k views

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 ...
Stefan's user avatar
  • 117
1 vote
3 answers
2k views

I have an issue that is driving me crazy. All these lines are 2 in height, but when moving around the screen they change thickness. As you can see the top line is thinner. What can be done to make ...
Majs's user avatar
  • 415
0 votes
1 answer
128 views

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 ...
juztcode's user avatar
0 votes
2 answers
820 views

I have a UI button. I want a function to be called whenever I press a specific key on my keyboard while my mouse is hovering over the button. I want to make something similar to UI in Ark SE where you ...
Rory Tait's user avatar
0 votes
4 answers
2k views

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 ...
AriaMath's user avatar
0 votes
1 answer
199 views

I am having trouble understanding how to trigger a UI button with a specific joystick key only. Currently i have a pause menu in which i have several buttons. By pressing start i set the game time ...
FSic's user avatar
  • 188
0 votes
2 answers
5k views

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 ...
caleidon's user avatar
  • 591
0 votes
2 answers
2k views

I am trying to wrap my head around the concept of the Canvas in Unity and its many uses especially outside of user interfaces. However, I cannot really find a good tutorial that digs deep enough into ...
Gergely Kovacs's user avatar
0 votes
1 answer
1k views

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 ...
Gergely Kovacs's user avatar
1 vote
1 answer
747 views

I am trying to implement my own runtime color picker that's easy to use for touch interfaces. I want the hue slider to be a ring, along these lines, except the whole ring texture would rotate when ...
arcadeperfect's user avatar
0 votes
1 answer
206 views

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 ...
Vidit's user avatar
  • 3
0 votes
2 answers
1k views

Can I have a custom serialized class whereby I set a value in the editor and that value persists into runtime, as happens with serialized monobehaviour fields? Currently it sets itself to 0 or a ...
arcadeperfect's user avatar
1 vote
1 answer
260 views

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 ...
Stefan's user avatar
  • 117
0 votes
1 answer
750 views

I'm trying to update the sizeDelta of a RectTransform in OnValidate. I'm trying to grab the computed values from a Layout Group. Here's what I've got: ...
Programmer9000's user avatar
0 votes
1 answer
1k views

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 ...
Yeppii's user avatar
  • 3
0 votes
3 answers
13k views

Unity text is very blurry. How can I fix it? To be honest, I have no idea why it behaves this way: Hope that someone faced the same problem and will be able to share how it was tackled.
some1 here's user avatar
0 votes
1 answer
2k views

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 <...
lover of the feet's user avatar
0 votes
1 answer
1k views

I want to make my button do stuff when the player holds it. In this case, I want to make a grab function: when the button is down the character can grab objects, but if the button is up they do not ...
YouCanCallMe Syarif's user avatar
0 votes
1 answer
97 views

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 ...
YouCanCallMe Syarif's user avatar
0 votes
2 answers
214 views

I'm making a game where I have circles filed with words or pictures drop from the top of the screen to the bottom. they should spawn right above and then drop. I just started using unity a couple days ...
eitan905's user avatar
1 vote
0 answers
3k views

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 ...
Tudvari's user avatar
  • 801
1 vote
1 answer
64 views

Does Unity fire any events when the user clicks these buttons? Or is there a way how to hook up code to respond to these actions?
Magician Artemka's user avatar
0 votes
0 answers
635 views

I am making my own button using the Unity UI code, but now I got to the OnFinishSubmit () coroutine ...
Aimon Z.'s user avatar
  • 107
0 votes
1 answer
73 views

I could really use another set of eyes on this. I am running into this error: NullReferenceException: Object reference not set to an instance of an object I can't figure out. In the script below. I've ...
benbastien's user avatar
0 votes
1 answer
599 views

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 ...
CodeExplorer's user avatar
0 votes
2 answers
183 views

My character jumps when I press the right side of screen. The pause button is alsp in the top right corner. So when I press that button, the right side script always triggers and I don't want that to ...
YouCanCallMe Syarif's user avatar
0 votes
1 answer
76 views

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 ...
PWalkersCrisps's user avatar
0 votes
2 answers
127 views

I use Unity 2019.4. I made a script so that if a make a long press on the screen of my mobile phone, my Personnal Character stops. I created a button to shoot gun too. The problem is when I make long ...
Achie1's user avatar
  • 181
0 votes
1 answer
1k views

I'd like Unity to get a specific button with: GetComponent<Button>().interactable But how do I get a specific button with a name?
PWalkersCrisps's user avatar
0 votes
1 answer
979 views

I downloaded and specified to use a unicode font that supports musical symbols (Musica), but when I set the text value of the Text component to "𝄞" nothing is displayed? I tried using the ...
Emil's user avatar
  • 145
0 votes
2 answers
2k views

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'...
ineedahero's user avatar
2 votes
0 answers
651 views

I've already uploaded this question in the Unity forums but only got a response but not an answer or solution. Here's a link to the original post: https://forum.unity.com/threads/emission-material-on-...
Dark Kool's user avatar
0 votes
1 answer
6k views

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 ...
OKprogrammer's user avatar
2 votes
1 answer
7k views

I've been recently working on a videogame, and I'm trying to make a script that will destroy the game object it is applied to whenever the right mouse button is clicked on it. It doesn't function at ...
OKprogrammer's user avatar
1 vote
1 answer
4k views

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,...
SePröbläm's user avatar
0 votes
0 answers
116 views

I found this script on a tutorial that I want to implement into my game, but I first want to understand what it does and how it does it. The script is attached to a Joystick UI, which has the inner ...
KI.'s user avatar
  • 472
1 vote
1 answer
2k views

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 <...
Tanmayee Pathre's user avatar
2 votes
2 answers
14k views

I'm new to Unity and C# and have been struggling to figure out how to solve this. What I'm looking for is a way to make text display whenever a button is selected. (ex. Player selects a difficulty ...
FEZ_R's user avatar
  • 25
1 vote
1 answer
2k views

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 ...
LionCatDev Studio's user avatar
0 votes
1 answer
2k views

I have added a few text boxes in my Unity game and they are at the bottom. When I fullscreen the game after building it, the text boxes show up in the right place but if I shrink the tab, the text ...
DragonflyRobotics's user avatar
1 vote
1 answer
481 views

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 <...
Carolina M's user avatar
1 vote
2 answers
5k views

As title, I know Button can be triggered onclick by button.onClick.Invoke(); But how to simulate onclick event of Selectable? Thanks for the help.
qwerty's user avatar
  • 11
0 votes
0 answers
352 views

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 ...
verified_tinker's user avatar
1 vote
1 answer
2k views

I'm going to try out the community here once more, I haven't had very good look in the past with getting help. I'm iterating through a series of List() and I'm creating a bar graph and a line graph ...
John Connor's user avatar
1 vote
0 answers
299 views

I have created UI text object And then created Text field in behavior class: ...
Dims's user avatar
  • 161
0 votes
1 answer
769 views

In my Unity scene, I have a couple of spriteRenderers and a UnityEngine.UI.Button called ...
ChrisC's user avatar
  • 116
0 votes
1 answer
364 views

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....
geisterfurz007's user avatar
0 votes
1 answer
2k views

How to calculate a child UI image's anchoredPosition(?) based on screen position input? I'm trying to have the child UI image (Spotlight) show up where the eyeball UI is, but it seems to always be ...
ina's user avatar
  • 294
0 votes
1 answer
721 views

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 ...
Shane's user avatar
  • 101
0 votes
1 answer
3k views

In my game, I assigned all of the blocks to be 2D sprites so that they could be easily converted into prefabs: However, when designing the drag and drop scripts, I noticed that all of the drag and ...
kayra yorulmaz's user avatar