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
47
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 ...
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
219
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&...
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
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
163
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 ...
0
votes
0
answers
53
views
Unity Editor Api for scriptable object apply on Edit Mode
So i want to design an editor which has the following requirements.
Suppose i already have a prefab called Player.prefab and script attached as Player.cs
And have a scriptable object called ...
0
votes
0
answers
76
views
Unity UI Images without a sprite set are invisible when the containing scene is loaded additively
I have a game with several scenes, all loaded using addressables:
A persistent scene that stays loaded with things like the main
camera and certain common game systems.
A lobby scene
A game scene
...
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
28
views
why my button isn't showing clicked in unity [duplicate]
So i was following this tutorial https://youtu.be/lF26yGJbsQk to make a start button for my unity game. But some how the button is not working and don't know why?
0
votes
1
answer
50
views
Why does a numeric input field appear in my Unity event when it doesn't in the tutorial?
I was making a game main menu by watching a video online.
In that video, while setting the volume Slider, after adding the coded script in the On Value Changed section and selecting ...
2
votes
2
answers
155
views
How would I make minimap of racing track where dot follows track progress in Unity?
I would like to show race progress in my UI. My minimap is like sketch below:
Blue dot represents progress and red dot is finish line. I would like this to work in UI so only blue dot would move. If ...
0
votes
1
answer
133
views
Image over everything Unity
I want to create a UI for a VR game to use it as a loading screen, the scene has a camera an image, a text mesh and a loading icon, the image is the background and the text and loading icon should be ...
0
votes
2
answers
164
views
Add round edges to heptagon shaped image with fill in Unity
I am not sure if this is possible I have this image:
This is how it looks when I do radial fill:
My question is if there is a way to make edges rounded while filling the image.
Rough sketch of what ...
0
votes
0
answers
57
views
Why do my shaders render differently in the simulator?
I am using simple shaders on the cards in my game. The shader is assigned as a material to a white image the covers the whole card.
They render as intended in the scene view, but do not in IOS ...
0
votes
0
answers
71
views
Why do Unity UI toggle groups update *after* the default time in Execution Order settings?
Why is toggle group after default time in the default script execution order in Unity?
2
votes
1
answer
480
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 ...
0
votes
1
answer
96
views
Using an InputField to enter a distance and then move an object to a location based on the input: object returns to old position
I have attached a script (1) to the InputField for ease and it displays HA changing when I alter it during run time in the ...
0
votes
0
answers
35
views
Unity UI Image sprite (stretch) tiles when assigned from Texture2D at runtime (?)
For some reason a Unity UI Image that is set to stretch becomes tiled when assigned from Texture2D at runtime (?)
0
votes
1
answer
189
views
UIElement button does not work when clicked
I have a small issue with my UI. Whenever I click a button on my pause menu ui nothing happens even when I hover over the buttons. However, in my main menu scene, the UI works without any problems. ...
0
votes
1
answer
242
views
Canvas that should only be visible for local player is also visible for remote players
I'm using Unity NetCode for Game Objects. I have a player Prefab, inside it I have a canvas as a child of my player Prefab (I don't know if it's the best approach), which contains inventory, status, ...
0
votes
0
answers
93
views
Add a controls instruction overlay to game HUD
I was wondering how I could make an instruction panel for the users of my game in Unity.
I will add a photo to this post that shows an instruction panel.
Any explanations would be much appreciated!
0
votes
1
answer
333
views
Unity debug error “Frame not in module”
I'm creating a 2D game, and all my game layers are UI canvases. Here's the issue: during debugging, every time I click on the screen, Visual Studio stops and displays "Frame not in module," ...
0
votes
1
answer
544
views
Clicking UI button calls event twice
I've designed a game where, when a button is clicked, the moving point stops. If the button is clicked again, the moving point starts moving again.
I only click on the button once, but the ...
0
votes
2
answers
199
views
How to remove loading delay when loading from Appdata? Or to load everything at start?
Currently, when loading from Appdata, there is a noticeable delay. See a sample video here, when it changes from the sprite set in UI to the sprite loaded from Appdata through C# script.
I want to ...