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
0 answers
22 views

How to adjust resolution to display only in portrait mode for both phones and tablet devices?

I am facing an issue where I'm able to adjust the resolution for different phones like Android and iOS but not for tablet devices. Is there any way to set it, for all kinds of devices, to display only ...
Mohammed Rilwan Ibrahim's user avatar
0 votes
0 answers
22 views

How to update other players after adding a character to the text UI

Hello I'm new to multiplayer development and I'm using photon pun 2 in Unity engine C# language. How can I update other players every-time I add another character to my text UI. The characters that ...
Ryan Cat's user avatar
0 votes
1 answer
41 views

How to alternate child placement to the left and right in a vertical stack?

Is it possible to arrange alternate children separately in a vertical layout group? I want to arrange the child elements so that one is aligned to the left, the next one is aligned to the right, and ...
fatdrogen's user avatar
  • 230
1 vote
2 answers
87 views

Interacting with World Space UI

Been struggling with this one for a while. I've found a few other posts across Stack Exchange and the Unity forums that seem to have the same problem, but their solutions don't work for me (at least ...
rpatton583's user avatar
0 votes
1 answer
42 views

When switching between two scenes: MissingReferenceException: The object of type '...' has been destroyed but you are still trying to access it

I recreated the problem in a new project to check and test the problem, but I don't understand it. Two scenes: First scene A GameObject with this script that simply jumps to the second scene. ...
Baro's user avatar
  • 119
0 votes
1 answer
41 views

Why doesn't RectTransform.GetWorldCorners() employ any camera?

Typically, conversion methods from world to screen coordinates and vice versa use a camera to perform these calculations, so I'm wondering how does GetWorldCorners ...
Serg's user avatar
  • 353
0 votes
1 answer
29 views

3rd Button on UI Seems to not Register the onClick.AddListener()

I have a UIManager meant to control the UI. The UI manager is attached to an empty game object. The Canvas has three panels, ...
Tim W Glass's user avatar
0 votes
2 answers
36 views

how can I make dropdown elements unselectable, but can visible?

this is basic dropdown Ui object I want to make it ,if I click dropdown, show every elements but can only select top element others not. like this image, because I made tutorial. how can I restrict ...
Byungheon Lee's user avatar
0 votes
0 answers
16 views

weird white outline on dropdown menu in unity

I have a dropdown and whenever I click it, this happens: How do I get rid of these outlines? It seems to be caused by the dropdown object that gets spawned not letting you set the background color ...
Wijiler's user avatar
0 votes
1 answer
105 views

How to hide UI elements in Unity?

I'd like to ask a case when developing a game using Unity. There are many UI elements in the game. These UI elements normally disappear from scenes when the purpose is achieved. However, the ...
Byungheon Lee's user avatar
0 votes
0 answers
17 views

OnPointer events trigger when entering transform, not on custom collider

I want to create a custom UI, specifically an action wheel which offers different actions depending on where or what was clicked. To do that, I create circle segments (slices). I also create a custom <...
ElDuderino's user avatar
0 votes
0 answers
33 views

USS class color background not functional

Dealing with UI Builder for created interface button, I need to change properties background color with uss class stylesheet. I created a class stylesheet .buttonControl which drag'n drop into button ...
miltone's user avatar
  • 101
0 votes
1 answer
55 views

How to create custom UI element from Hierarchy Menu in Unity?

I have a custom UI element and I would like to instantiate it from Hierarchy like you do with any other UI element (button, text etc.). I know how to do this so it is instantiated in the scene but how ...
Ivan's user avatar
  • 307
0 votes
1 answer
121 views

Is it possible to detect if the cursor is over a GameObject with a specific tag?

I've tried quite a few things, but none of them have worked reliably. Here is what I'm currently using: ...
THE JOATMON's user avatar
0 votes
1 answer
107 views

Particle system objects in UI disappears/appears on screen unless I change the sorting rank

This happens to all particle systems. I tried: Changing the rendering mode to camera, setting culling mask to UI, particle system layer set to UI Adding a canvas child, and attaching a particle ...
Alex's user avatar
  • 103
0 votes
0 answers
28 views

Is it possible to add light/fire effects to the sprite used in the UI (Using Unity 2021.3.25f1

Essentially I want to light all orange areas Tried changing the render mode on the canvas and rearranging the Image object in the canvas - nothing worked.
Alex's user avatar
  • 103
0 votes
0 answers
55 views

Unity WebGL Game's Canvas UI scale changes with windows scale

So this is the setting that is affecting my game. My game is a webgl build from unity running in chrome, hosted on itch.io. At 100% windows scaling setting, the UI elements have expected size,...
Utkrist Karkee's user avatar
0 votes
1 answer
105 views

In Unity editor, how to import package from github?

In the latest Unity editor 2021.3.25f1 LTS, I'm trying to directly import the following package from github: https://github.com/yasirkula/UnityNativeFilePicker/releases/tag/v1.3.0 But when I import ...
tribbloid's user avatar
  • 111
0 votes
1 answer
51 views

Show an image as Tooltip in a Unity 3D

I got the following question: How to show an image as Tooltip in a Unity3D? The image should only be visible if the user hovers over the 3d object. Thanks in advance, hidayah
Hidayah__0111's user avatar
0 votes
1 answer
37 views

TextMeshPro Page Mode Issue (Readable Books In game)

I'm trying to implement readable books into my game. Much like Morrowind and Skyrim. I have a system that sort of works, but it appears as though there is a bug that is duplicating some page data, and ...
Krythic's user avatar
  • 790
0 votes
0 answers
115 views

Unity SetActive(true) not working for panel

So I have a finishMenu that I'd like to activate when the player finishes the level. I have a UI container (canvas) that contains among other things, my finishMenu. When colliding with a finish pad, ...
View's user avatar
  • 1
0 votes
0 answers
150 views

Change textures dynamically on 3D animating object in runtime

I have the following situation, where in I need to animate textures on 3D animating plane in runtime. There are 5 panels in the unity scene and two buttons, each button, when clicked triggers one ...
Omkar P's user avatar
0 votes
0 answers
12 views

How can I attach an UI Builder/ Toolkit based wrist UI/ virtual smart watch to the wrist in XR?

I have a Unity project based on https://developer.oculus.com/documentation/unity/ using Unity 2021.3.23f1 . The OVRPlugin is set to OpenXR. In XR Plugin-In Management Oculus is selected. The ...
Torsten Knodt's user avatar
0 votes
1 answer
41 views

How do I create a button with a font by code?

I have written a code that would create background image as a button and then show a letter on that button. This should become a virtual keyboard. I am experiencing weird drawing that looks like this: ...
tmighty's user avatar
  • 869
2 votes
1 answer
413 views

How to make a sprite fill the image?

I created a custom UI Button: However, when I use the sprite as the image for a button it doesn't fill out the whole "Collision" area: This is an example of how I want it to fill the "...
Motcho's user avatar
  • 23
0 votes
1 answer
603 views

UI Toolkit not firing button clicked event

I'm using the new UI Toolkit and new Input System together, and I've setup everything correctly the Input Actions has separate input for UI, the Input System UI Input Module is setup correctly, the ...
Džoni's user avatar
  • 1
0 votes
2 answers
444 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 ...
Frederik Steinmetz's user avatar
0 votes
0 answers
108 views

How to select only inventory slots, and not deselect them when clicking somewhere else?

I'm trying to make a selection system in my inventory to do things to the selected item in a UI window using this selection system. The problem is that whenever I click on anything other than the ...
Ohne Dich's user avatar
0 votes
2 answers
137 views

Unity UI button not working

I'm creating a game in unity and I can't get the UI buttons to work. Here is what I tried: Added a graphics raycaster to the canvas Added an events system with an Input System UI Input Manager ...
FortCraftCoder's user avatar
0 votes
1 answer
303 views

Scroll UI Image

Currently, I am scrolling a UI RawImage using the following: ...
PayasoPrince's user avatar
1 vote
2 answers
101 views

UI Scaling issues only with QHD and 4k UHD

I have a card game, where I'd like to be able to zoom in on a card if it's right clicked. I coded to make sure that if the zoomed card would go over a screen boundary, instead we would anchor it such ...
Steve P.'s user avatar
  • 123
0 votes
1 answer
510 views

How to smoothly transition between two images in a image component?

I have a state machine responsible for transitioning between different images, corresponding to player actions. I want to make the image a part of UI, but my main question is how do I transition ...
koogel's user avatar
  • 79
0 votes
0 answers
15 views

How to change GUILayout depending on selected asset?

I'm making an editing window for some in-game stats. I have a few different stats in there with the same fields, like stats and stats of equipment. Because these fields are so similar, I want to make ...
Dead Lord's user avatar
0 votes
1 answer
27 views

How to implement "Auto Generate Animation" and "Visualize" buttons in custom Button inspector?

I extended the Button class with my own variables. I also had to create an Editor script since Unity manually draws the Button's fields into the Inspector. I just need to know what the functions that ...
CraftedGaming's user avatar
0 votes
1 answer
204 views

Assign clickable function to UI Button Unity

So I'm trying to change the function of a button by a clickable method in Unity. I'm using a GetComponent to access the button component of the game object and then ...
curry girl's user avatar
0 votes
0 answers
68 views

Lag when filling overlaid images

I'm having an issue where my UI lags if I try to fill an image that is placed in front of another image. Here is the effect I am trying to achieve: As you can see I have an image in the background (...
Cato's user avatar
  • 33
0 votes
1 answer
566 views

UI not scaling properly

I'm trying to create an endless runner type game where once the player dies, a popup opens letting the user know that the player can be saved by watching an ad. This is how the popup looks in the game ...
single arrow games's user avatar
0 votes
0 answers
50 views

How to trigger an action when a Scene asset is dragged into an Editor window?

I'm new to Unity and have been researching whether it's possible to accomplish the automatic creation of a scene thumbnail into the scene view. Ideally, I would be able to simply drag the scene asset ...
McArthey's user avatar
  • 205
1 vote
1 answer
342 views

Is it possible to keep a prefab of a UI element with UI Toolkit?

I'm digging into Unity's new UI Toolkit, and so far I like it a lot; but there are a few things bugging me about it. I have a dynamic list in my UI which keeps track of way point paths, and it changes ...
Michael Macha's user avatar
0 votes
1 answer
189 views

Unity button highlight not working properly after spawn

I am instantiating a UI button. After it spawns if I hover on the button it highlights properly. The problem is if I spawn the button and the mouse position is already on top of the instantiated ...
theCodeHermit's user avatar
0 votes
1 answer
88 views

Updating UI Graphic vertex positions through code

I'm trying to update the positions of vertices in my project. I'd been using Unity's built in Line Renderer previously which worked fine, but had some problems when points got too close to each other. ...
Mathias Algot Søllested's user avatar
3 votes
1 answer
769 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 ...
Federico Tomasi's user avatar
1 vote
1 answer
398 views

Should I destroy dynamically created Image.sprite?

Image sprite is created programmatically _image.sprite = Sprite.Create(texture, ...); Should I destroy it before replacing with a new one? P.S. My question comes ...
Serg's user avatar
  • 353
0 votes
1 answer
64 views

Remove default menu controls

I have a vertical layout group filled with UI buttons used as menus in my game. They work well for mousing over and clicking, and I am in the process of adding keyboard controls. The issue I have is ...
Hoog's user avatar
  • 121
1 vote
1 answer
169 views

Canvas scaler does not work when the UI is Instantiated at runtime

My canvas scaler does not work when the UI is instantiated dynamically. It does work well in iPhone 6.5 inch simulator: The problem is when I use 5.5 inch or smaller simulator: It does not follow ...
stingalimian galimian's user avatar
0 votes
0 answers
329 views

AudioSource.isPlaying is not working in Unity WebGL Build

I am passing a clip to play on the audio source. Next, I wait for the audio to finish to invoke the next action. But the waiting loop never ends. Once the audio clip ends, the time I read from ...
Manoj Balaji M's user avatar
0 votes
1 answer
181 views

How to show orientation on an image minimap in Unity

Initial Question: I'm trying to create a minimap for my game in Unity. It consists of a 2D image sprite within a mask. I've got the rotation and the movement within the mask down, but the only problem ...
Sudsy's user avatar
  • 1
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 ...
mike's user avatar
  • 481
0 votes
0 answers
35 views

Make player object freeze / become non-interactive when text pops up

I have a Dialogue system that shows up when a scene starts or a player touches an object. I am wondering if is it possible to make the player freeze/not interactable when dialogue pops up. I don't ...
Maiz's user avatar
  • 1
1 vote
0 answers
352 views

How to distinguish pointer up inside button vs drag-out

I am making a unity mobile game, I have a simple scene and a canvas with a few buttons and these buttons have scripts that detect if the button was pressed and released. Here is the code for doing ...
zmac's user avatar
  • 11