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
25 views

Unity Canvas on Quad blocking mouse click sometimes?

I'm working on a card game that has quads with world space canvases on them. I've been using OnMouseOver() and ...
Gage Adam's user avatar
1 vote
1 answer
62 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 ...
Kaiannae's user avatar
  • 113
0 votes
1 answer
49 views

How to get value of transitionDuration in C# for Unity UI Toolkit

My existing code for this task is: ...
Mfa Xyz's user avatar
  • 11
0 votes
1 answer
43 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 ...
Stan's user avatar
  • 3
0 votes
2 answers
64 views

Unity UI Buttons not working (not clickable)

Buttons Easy, Medium and Hard can not be clicked even though Restart Button was clickable from the start. All of the buttons have interactable checkbox on and raycast target on. Shadow panels and ...
Pablo Frank's user avatar
0 votes
0 answers
14 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 (?)
ina's user avatar
  • 284
0 votes
1 answer
16 views

Unity UI Builder InvalidCastException

I am making a custom UI with the UI Builder for my scriptable object that holds some data for the AI Player. It all worked fine until I added a third slider for a new value I needed; now the object ...
Džoni's user avatar
  • 36
0 votes
0 answers
27 views

How to display puzzle pieces within the UI panel upon the initial generation

...
hansueyuu's user avatar
0 votes
1 answer
38 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. ...
Miracle's user avatar
  • 23
0 votes
1 answer
25 views

Fade-in sprite in TextMeshPro

...
Nader Amir's user avatar
0 votes
0 answers
31 views

Javascript global variable doesn't update

Here is the scenario, I have a GetImageAerial.jslib which has function something like this ...
Suriya Swami's user avatar
0 votes
1 answer
42 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, ...
Jamelaumn's user avatar
0 votes
0 answers
36 views

Is it possible to prevent a graphic raycaster blocking 2D rays in different layers, from a different camera?

I have a graphic raycaster attached to a canvas, with the blocking layer set to exclude all layers except "UI": ...
arcadeperfect's user avatar
0 votes
0 answers
36 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!
Cezar P's user avatar
  • 45
0 votes
1 answer
95 views

How can I instantiate a prefab in a canvas and have it positioned relative to its parent?

I am trying to load, at run time, a UI prefab and have that display on a canvas. I was following the directions found on this forum. I am able to get it to load and display, but it is not showing up ...
tatmanblue's user avatar
0 votes
1 answer
83 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," ...
Alisa's user avatar
  • 1
0 votes
2 answers
166 views

Adding text label to sprite

I'm completely new to Unity. I'm trying to create something similar to Scrabble. I've simply got a tile as a sprite (red arrow).Firstly, I don't understand it being so small.. I'm trying to give the ...
Kingsley Obeng's user avatar
0 votes
1 answer
168 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 ...
Alisa's user avatar
  • 1
0 votes
1 answer
73 views

Why can't I press buttons after re-enabling the UIDocument?

I have this UI with buttons that should be clickable whenever the UIDocument is enabled, but for some reason whenever I disable and then re-enable the UIDocument (in the second code block), the ...
skundu's user avatar
  • 1
0 votes
2 answers
98 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 ...
Junjie J2's user avatar
0 votes
0 answers
38 views

Enable socket interactor only when previous sockets are occupied

There are 3 boxes and 3 socket interactors. I only want the second socket interactor to work when there is a box in socket one and the third to work when there is a box in the first and the second ...
SPP's user avatar
  • 1
0 votes
0 answers
105 views

How to prevent transparent world UI elements from hiding post processing?

I have transparent world ui elements in my game like so: What I've been noticing is that post processing through transparent elements is nonexistent, even though other parts of the scene work with ...
Elon-Musk-YAY's user avatar
-1 votes
1 answer
120 views

unity onTriggerEnter does not work

so in here there is a box to which i have attaches this script and ATTACH1 is a socket interactor here i want is when the box which i have attaches attaches to that socket interactor the text which is ...
SPP's user avatar
  • 1
0 votes
0 answers
24 views

Input while using Input System and Unity UI [duplicate]

I'm using Input System and Unity UI and the problem I have is a single event (i.e. mouse press) is being sent to both systems. Here are a few interactions to demonstrate the problem. Clicking on a UI ...
stripies's user avatar
0 votes
1 answer
44 views

"Button is not an attribute class" error when integrating Steam achievements

I am writing the code for my button, but it's giving me errors like this: Assets\Scripts\SteamIntegration.cs (60, 6): 'Button' is not an attribute class Where did I make a mistake in this code? <...
Syeda Aqsa Sakina's user avatar
0 votes
0 answers
64 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
28 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
68 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
  • 238
1 vote
2 answers
708 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
202 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
171 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
  • 373
0 votes
1 answer
34 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
93 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
25 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
319 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
41 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
141 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
163 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
  • 317
0 votes
1 answer
426 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
291 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
38 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
92 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
238 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
84 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
59 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
149 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
166 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
19 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
64 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
  • 919
2 votes
1 answer
840 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