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

Need Suggestions for making smooth UI animation which does not bloat the file size or heat up my device?

I was trying to animate some UI Images for my game, but I came across some problem. For Context the animation which I want to use will be having some squash and stretch of the sprite(It would be like Mesh Deformation of the sprite). I am wondering…
0
votes
1 answer

Spawning GameObject in AR plane except on the Button UI area

I am developing an AR Measuring tool where I'm placing my measuring point disk on the AR Plane. I have added an Undo and Redo button for this, as there is a chance one removes the last placed point using undo button. Now my issue is that, when I…
P D
  • 23
  • 8
0
votes
0 answers

Line Renderer on Unity UI 2D

Line Renderer is showing up in Scene View (Over UI), but it's not showing up in Game View. I'm trying to make the line renderer show up on top of my UI/Canvas. I'm currently using this video's line…
Jayce
  • 1
  • 1
0
votes
1 answer

Removing the touchCount on Button without removing it's click ability function in Unity

I am coding for a scene where QR Code is generated according to the last position I'm touching on the screen but when I touch the button for generating the code, the last position becomes my button. Is there a way where the 'Input.touchCount'…
P D
  • 23
  • 8
0
votes
0 answers

when I Destroy a GameObject with Button and Instantiate anthoer one which has the same name,I cant set the Button interactable false

I'm producing a SRPG which is based on hexagonal grids. The frontend UI and the backend data of chess and the map are separated.Every times I move a chess,the button on chess invoke backend methods to run the results which are updated in backend…
0
votes
0 answers

keyboard Has spaces on the sides

I am using the text mesh pro input field when the user clicks on it the keyboard has a space on the sides for some reason how can I fix it? image
Omer4213
  • 1
  • 2
0
votes
2 answers

How to detect a mouse clicked on a UI element

I'm trying to make a toolbar system in my game but I can’t find a ways to detect a mouse click on a UI element only or to detect if it's over it, the regular detect system isn’t working. I tried: void OnMouseDown() { Debug.Log(“yay”); } But the…
0
votes
0 answers

How to instantiate children of a custom element in UI Builder using a script?

Basically, I'd like to make a simple non-scrollable list containing other VisualElements. In order to simplify workflow and allow reusability, I want to make a custom element where I could input an integer for the number of entries in said list in…
reck11
  • 1
  • 1
0
votes
0 answers

Unity - referencing Text Mesh Pro sprite assets string constants

I'm finding myself inputting some nasty bits of hard-coded sprite asset string references in my code like this: [SerializeField] TMP_Text _purchaseLabel; private void UpdateState() { _purchaseLabel.text = "" +…
Dror
  • 2,548
  • 4
  • 33
  • 51
0
votes
0 answers

Unexpected unity HorizontalLayout behavior when using spacings and/or paddings

I've build simple chat UI where instead of text input you have options for my game. And it works. Kind of. The problem is when adding elements instead of just shrinking already existing elements to keep spacing and padding HorizontalLayout…
everr
  • 28
  • 5
0
votes
1 answer

Unity UI.Button not registering Pointer events

I'm trying to learn Unity again and one of the many (seemingly easily) things I'm struggling with is trying to get my ButtonEvents script to fire when interacting with my Button UI component. I'm trying to get my script to log to the console when…
thathurtabit
  • 558
  • 2
  • 11
  • 22
0
votes
0 answers

How to stop Screen Space Overlay canvas from blocking UI button presses on World Space canvas?

I'm using Unity 2022.1.23f1 and the Universal Render Pipeline. I have a render texture, set to 480x270 with point filtering, to get a cool pixelated effect. In my scenes, I output the camera into the pixelated render texture and render it in a raw…
Pietu
  • 1
0
votes
1 answer

How can I change the size of a VR game canvas (height and width) depending of their content?

I'm making a VR game where I hava a unity canvas set up as Word space, I'm plannoing to add a plane as background to provide better constrast and use the colliders to allow the user grab it and place it wherevet him wants. I need to change the size…
Eduardo Corona
  • 1,262
  • 4
  • 20
  • 31
0
votes
1 answer

I want to make Highlightable button while PointerEnter in Unity2D Canvas but that should be Unselectable

Buttons cannot be highlighted when they are selected in Unity Canvas. I only want mausehover/pointerEnter thing. I am making a platform based 2D mobile game. Users can move their fingers without take off from the screen. So I don't need Pressed and…
knoxia
  • 1
  • 3
0
votes
0 answers

How i can handle all Unity UI animations on single update function

I'm making my own animation library I want to handle all animation logic within a single Update function. Here is the code [RequireComponent (typeof(RectTransform))] public class UIMotion : MonoBehaviour { public enum MoveDirType { …
user17248503