Questions tagged [unity3d-ui]

For questions regarding the UI system of Unity game engine.

Use this tag for questions on how to use elements of Unity's UI system (such as scrolling panels, buttons, sliders), how to connect those dynamically to code, and how to use the reactive layout system of the UI system.

Unity has full tutorials of the UI subsystem here https://unity3d.com/learn/tutorials/topics/user-interface-ui including both video and written tutorials.

The class UnityEngine.UI can be found at these URLs https://docs.unity3d.com/ScriptReference/UI.Button.html

35 questions
2
votes
2 answers

ScrollRect does not correctly update the position when clamping the normalized position, after removing/deactivating a child element from the content

This is an issue that I had to resolve myself after finding no solutions for it. The issue was that after removing a GameObject element from the ScrollRect's content, it would not clamp its normalized position until the user starts moving it again.…
Alex
  • 101
  • 1
  • 2
  • 6
2
votes
1 answer

Unity3D text and buttons not showing in iOS and Android

I have built a simple game using Unity3D v. 5.4. When I tried to deploy it on iOS and Android devices, the text views and the buttons I use in the game are not shown at all, although the button's action is taken and reacts correctly. Here is the…
Amani Elsaed
  • 1,558
  • 2
  • 21
  • 36
2
votes
3 answers

UI prefabs: buttons does not retain onclick() settings

I have a simple prefab, made by a prefab button and a panel. The button is placed inside the panel so it is a child of the panel. I did save the prefab and all is good. Then, I did add a click event on the button; so I did add the gameobject where…
user393267
2
votes
1 answer

How do I put controls on screen?

I am working on a project using Unity/Vuforia to build an Augmented Reality app for Android and need some help. I have a ball appear on screen when the imagetarget is found. I cannot figure out how to get the ball to move around. I can use virtual…
ZombieDude
  • 129
  • 1
  • 1
  • 10
1
vote
0 answers

How to debounce UnityEngine.UI.Button.onClick

Situation On old and worn-out controllers, sometimes pressing down a button a single time will result in multiple button presses. I'm aware of ways to handle that issue when it comes to my own game logic. However, I'm unaware of a clean solution…
1
vote
1 answer

Issue with a walk target in unity c# Vr

I am making a game where I am trying to get Ethan (AIThirdPersonController) to walk to where ever the user is. The user moves by looking where they want to go and then start and stops with a button click. the code I wrote for ethan to go to…
1
vote
1 answer

How to make custom Unity LayoutGroup expand to fit contents

I am attempting to use a custom FlowLayoutGroup as described in the answers of this question ( also up on GitHub) in a situation where it needs to resize vertically to contain it's children. My setup looks like this: ScrollableRect Panel with…
Stan
  • 31
  • 1
  • 4
1
vote
2 answers

Button `OnSelect` not functioning in Unity.UI Canvas situation

I have three buttons, when you tap one button, a panel with a text appear. The problem is when I attached the script, nothing happens. The "click" is registered but the the panel never appears. My script is attached to each of the button and is…
Angelica cruz
  • 81
  • 1
  • 11
1
vote
0 answers

Sprite size for a new UI in the constant physical size mode

I want to provide the HD version for xxhdpi Android and other devices. Of course, I need to make all sprites with minimal size as it possible to show a graphics with any artefacts. So, I try to detect the preferred size for UI sprites. My Canvas in…
Denis Sologub
  • 7,277
  • 11
  • 56
  • 123
1
vote
1 answer

Unity3d UI not responding after Chartboost ad

I have added the chartboost intersitial ad for android unity3d project. Now the ads load correctly and are showing correctly in the scene that i have specified. The issue comes when the user navigates to the ads url. Once the url is opened and if…
1
vote
2 answers

Detect continous touch on GUI button

Below code use to implement the backspace button functionality which runs under a GUI button OnClick. public void BackSpace(InputField userField) { string textEnter = userField.text; string tempString = textEnter.Substring(0,…
Muhammad Faizan Khan
  • 10,013
  • 18
  • 97
  • 186
0
votes
0 answers

Unity3d Button do not respond to first click, need another one

I have a gui (WebGL) with buttons that do not respond on first click. This specific button: ...is a search button. The process is as follows: Click on the yellow search button Button turns green and inputfields are emptied to prepare for search…
PeterK
  • 4,243
  • 4
  • 44
  • 74
0
votes
1 answer

How to make TextMeshPro input field adjust its raycast area based on its text?

I'm creating UI for my game. I've already created simple elements like animated buttons and multi-option switches, but I have a problem with input fields. That's how it looks now. My goal Raycast receiving area should be same size as text. Text…
trollingchar
  • 760
  • 2
  • 6
  • 18
0
votes
1 answer

EventSystem misinterprets button clicks

I have a problem with clicking on UI buttons. In this video you can see a problem. VIDEO
JediMan
  • 43
  • 1
  • 8
0
votes
1 answer

Unity3D UGUI Canvas Gizmo

Is it possible to draw Gizmos (https://docs.unity3d.com/ScriptReference/Gizmos.html) in the scene view.. but overlaying the UGUI Canvas (within the scene view) and not particularly in world space? I'm looking to outline some UI elements in the…
slumtrimpet
  • 3,159
  • 2
  • 31
  • 44