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
16
votes
1
answer
6k
views
Blank 2.2 KB sized PNG costs 2.1 MB in Unity? What does this represent? What to do?
I am starting to work on optimization for my app. I need to understand the information Unity displays about file sizes. For example, just to prove a point, here is a 2.2 KB completely blank PNG which ...
13
votes
1
answer
80k
views
How does the Graphic Raycaster component work in Unity?
I'm making a small game for the first time and enjoying it thus far. The only thing that keeps bothering me is that I can't find a human explanation of what the graphic raycaster does. What's the ...
11
votes
1
answer
3k
views
Non-stretching health bar?
Here's what I want:
Here's what I got:
What is this procedural image unmasking called? Popcap didn't do image-splitting (source images below), but I feel like I'm missing the obvious here.
(Source ...
4
votes
5
answers
2k
views
Clicking pause button makes character jump before pausing
I have an issue with my Unity 5 game. When I click on the Pause button, my character jumps before the game is paused.
My script detects the click to trigger the jump jump before the pause button. I ...
3
votes
2
answers
2k
views
What does this Yellow Outline represent in Unity Text Mesh Pro?
What does this Yellow Outline Represent around Text Mesh Pro Text objects in Unity? I don't see any regarding them in the inspector making it so that I have eye-ball it in the scene view to make it ...
3
votes
1
answer
1k
views
Screen split in different regions, each with a different scene
I am a complete beginner in Unity and, after having search for a while, I am still not sure if it is actually possible to achieve what I would like to do.
My goal is to have a game where the screen is ...
3
votes
2
answers
1k
views
Rendering transparent UI in Linear Color Space
As you may know, Unity can have issues correctly rendering transparent 2D Sprites/Textures exported from Photoshop or Figma. Reason being that most of these tools operate in Gamma color space while ...
3
votes
1
answer
984
views
enabling / disabling components from editor, while avoiding "SendMessage" warning
I am creating an editor tool that requires me to enable / disable components and or gameObjects via script while in edit mode. Currently everything that has to execute in edit mode is called from <...
2
votes
1
answer
14k
views
How do you repeat a tile texture horizontally/vertically in a UI Image?
It seems Unity UI Image supports Image Type 'Tiled', but I'm not sure how to get the tiling to work both vertically and horizontally. Can someone help me understand?
2
votes
2
answers
14k
views
How to call a function in response to a Button's OnSelect event?
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 ...
2
votes
1
answer
5k
views
Sprite button not triggering "On Click()" event
Hi have created some buttons from sprite and I added image and button components on it.
I am just using sprites because In my game the camera can be moved on x and y. But I don't want my button to ...
2
votes
1
answer
115
views
Ball always showing in Unity
Some weird "ball" is showing when I select an element in Unity, preventing me to see the object itself:
I've tried to hide some layers, but even with all layers hidden it's still here:
Do you know how ...
2
votes
1
answer
5k
views
How to create instances of a Unity UI Toolkit template from code?
I'm using Unity UI Toolkit in Unity 2021.2.
Looking at the following example:
...
2
votes
1
answer
1k
views
How to make a Unity slider sit over evenly spaced points?
I'm working on a timeline UI element in Unity, that looks like this:
I generate the bottom ticks by instantiating a number of times over the length of the parent RectTransform, and offsetting them on ...
2
votes
1
answer
487
views
How to manage UI sound effects?
I'm making the main menu for a small game I'm making, and when I was learning how to make buttons etc.
In order to make the buttons have a sound effect when pressed and so on, I was told to add an ...