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
1
vote
1
answer
51
views
Can't get a Prefab to scale down accordingly inside a Container
I have a prefab with some fixed sizes on itself and its elements:
Then added a Aspect Ratio Fitter and a Preferred Height:
.
When using that prefab from a container with Horizontal Layout Group with ...
1
vote
1
answer
72
views
Change sprites for multiple image in one function
I am trying to make a digital clock (24:00 type), where each number is an individual image, that should change. So, I want to change sprites for multiple images in one piece of code.
But when I ...
0
votes
2
answers
86
views
UI tween animation completely different on Phone and in Unity Editor
I have this function that spawns an Icon from a world position and animates it to correct UI position. In editor it works fine but in apk on phone it has a wrong starting position. Now as I understand ...
0
votes
1
answer
222
views
How to position health bars above units in Unity regardless of camera location, angle and zoom?
Here is what I want to achieve, health bars that stay perfectly above the units, regardless of where the unit moves or where the camera is: https://www.youtube.com/live/fZSaPDz-GJc?si=B868wwF5KAPCuEtw&...
-1
votes
1
answer
70
views
How to match UI text size and position between editor and build?
In the editor, it does not matter if I set the resolution in the game view to my pc resolution (1920x1080) or to "Free Aspect".
The only thing that changes is that in "Free Aspect",...
0
votes
2
answers
138
views
How to highlight only specific part of the UI image in Unity?
How can I highlight only specific parts of an image in Unity?
My image would be something like the example below: a grid with text and fields. Text can be separated, but I would prefer it be part of ...
0
votes
1
answer
164
views
Resizing a Sprite in 3D space to match its native pixel size at a target screen resolution?
I am placing a 3D game object with a SpriteRenderer + Billboard attached to it in my scene.
However, since it's a distance away from a perspective camera, the sprite gets scaled, losing a lot of the ...
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 ...
0
votes
0
answers
50
views
How to change colours of UI in Unity using Animation?
I'm making UI that's using controller support, and therefore I have to script it and use an Animation, but how do I make sure that a color change when hovering over a button happens instantly, because ...
0
votes
0
answers
57
views
Blurry Board Game Node Images in Unity (UI & Sprite Issue)
I'm developing a board game in Unity and facing an issue with image clarity. The board consists of multiple nodes, each displaying a 480x600 px image. However, these images appear blurry and ...
1
vote
1
answer
283
views
How should I go about handling multiple phone resolutions from a reference resolution?
I built my entire game in Unity based on my Android phone resolution, both for UI and object sizes. Now, everything looks good for a 1080 x 2400 resolution, but I know that's not the aspect ratio of ...
1
vote
4
answers
2k
views
How to make TextMeshProUGUI truncate the left part (beginning) of a line?
I'm trying to display file names including their directory. When the file path gets too long for the text box, I want to align it right, because the filename is more important than the directory.
I ...
0
votes
1
answer
62
views
How to build a Unity WebXR scene that uses raycasters?
I am fairly new to Unity. I want to create a VR project that I build to WebXR and publish to the web. I am using the sample scene from this project and it helps me get up and running. I am able to ...
0
votes
1
answer
54
views
How to prevent button drift (despite anchoring) when resizing game window?
My Unity game has graphics designed for aspect ratios of 16:9, 16:10, 4:3, 3:2, and 19.5:9. This worked for mobile. But now I want to create a PC version for Steam, and I have to deal with the user ...
1
vote
1
answer
2k
views
is it possible to render world space canvas over other objects in unity?
for some pickable object, I display a UI canvas. It's attached to a scene gameObject. Sometimes the Canvas UI overlaps with some other objects. I need to make sure the UI is always renderer on top of ...