Questions tagged [unity-ui]

You use this tag to ask question related to Unity3d User Interface(UI) System. The Unity UI system allows you to create user interfaces fast and intuitively.

Unity's UI system provides game developers with tools for creating professional user interfaces, fast, intuitively and efficiently. With Unity UI, you can build simple screens for games—splash screens, level selection screens, or even high-score screens etc.

219 questions
0
votes
1 answer

OnPointerDown doesn't work with Canvas component

I am using canvas component for ovveride sorting, and when i use a object with canvas component, OnPointerDown doesn't detect clicks but when i delete, it can detect cliks, how can i use canvas and OnPointerDown at same object Canvas
Krivi S
  • 1
  • 1
0
votes
0 answers

How to enable ucss autocomplete in visual studio 2022?

I'm trying to make UI with UiToolkit but in ucss files development environment don't show me autocomplete options. How to enable them? Visual studio
0
votes
1 answer

Singleton null reference

I am trying to create a singleton that downloads textures from the web. but whenever I pass URL to singleton through the external script I get an error saying an object is not set to Instance of an object at line below: WebImage.instance.url =…
Omkar P
  • 29
  • 5
0
votes
0 answers

How Can I Stick (Pin) Sprite(3D World) To Ui Element In Unity3D?

I'm working on new project with portrait orientation. I have some UI element like button and etc. on top and bottom of my game also I have a TV in game and I want to stick it to my top UI Section and water bottle to bottom UI section(for example) on…
Nastary
  • 345
  • 4
  • 19
0
votes
0 answers

NullReferenceExceptionwhen using Unity UIBuilder drop down menu

I keep getting the following error : "NullReferenceException: Object reference not set to an instance of an object" I have copied the example code almost exactly and yet seems to keep getting this error when trying to change the choice list, here is…
0
votes
1 answer

How to keep a pop up window on the screen. (Unity 2D, UI Image, Screen space overlay)

How to keep a pop up window on the screen? (Unity 2D, UI Image, Screen space overlay) I have a pop up window 225x172 that I enable and change its transform to the mouse position as a pop up window. The problem I have is that if a user clicks near…
Ratbyte Boss
  • 461
  • 4
  • 13
0
votes
1 answer

Unity - Place UI elements to same y positions with different resolutions

I am working on 1920x1080 reference resolution. Am dynamically creating an UI element more than one. They are animating when they created. These UI elements instantiates from same prefab named "Drift_Stat_Tab". All of these created and animating UI…
sirmaci
  • 93
  • 4
  • 16
0
votes
1 answer

How to clamp UI dragging between values in unity

Here is what I tried. public void OnDrag(PointerEventData eventData) { float x; float y; rectTransform.anchoredPosition += eventData.delta; if (Background.transform.position.x >= xMaxBounds) { x = xMaxBounds; } …
kodarr
  • 1
  • 2
0
votes
1 answer

Unity UI Builder: Square Image in Button

so I'm new to the Unity UI Builder and I have a problem when it comes to displaying a square Image (VisualElement with texture in background) in a button. This is how the Element looks in the UI Builder. This is how the image looks when I resize the…
Daweed
  • 75
  • 6
0
votes
1 answer

Unity UI Toolkit - Background image

I was learning the new UI toolkit. I'm trying to add an image to a visual element. I added an image and saved it. After reopening it, nothing appeared like I didn't add anything. What can it be about? SS of it
tunity41
  • 1
  • 1
0
votes
1 answer

Unity2D UI>Image doesn't show the full image and appears differently between two projects. Why is it doing this?

I added a Unity UI>Image to my project with a given source image (called Btn_OtherButton_Blue). It appears cropped in some way. It doesn't show the full button image, the top seems cut off. I added a UI>Image to a different project with the same…
user2012741
  • 89
  • 1
  • 8
0
votes
1 answer

Rect.GetWorldCorners(Vector3[]) does not return correct values when the RectTransform is managed by a LayoutGroup

I'm using the function Rect.GetWorldCorners(Vector3[]) to get the array of corners of a Rect in world space. This works fine when the Rect is not managed by a layout group (i.e., Grid Layout Group, Vertical Layout Group, etc...). When I add a layout…
user11369406
0
votes
1 answer

How do I convert downloaded file type to pdf in unity?

I have a code where I'm downloading pdf file from server and storing it to Application.persistantDataPath. and then converting the pdf to Images so that they can be rendered on a book in unity. Here the issue is that whenever the file is downloaded…
Omkar P
  • 29
  • 5
0
votes
0 answers

How do I sort List of type FileInfo in c#/Unity?

I have below code where in I'm converting pdf to Textures ion unity, then I will be loading those textures into an array. But the pages are updated in array in unsorted format. How do I sort the array or List? Below is my code. public void…
Omkar P
  • 29
  • 5
0
votes
1 answer

A Unity prefab instance attached to the scene is receiving unwanted scaling

I'm managing a dynamic UI based on canvas. The UI is created with Layout groups (vertical and horizontal). One of the dynamic components of this UI is a prefab that I'm instantiating, filling with the needed information, and attaching to the parent…
MatterGoal
  • 16,038
  • 19
  • 109
  • 186