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
1
vote
1 answer

How do you sort UI elements in Canvas?

I don't get how you sort UI elements Z-index in Unity inside a Canvas, is it by hierarchy order ? I'm trying to do a settings screen like in this video: https://www.youtube.com/watch?v=-qNo1jloR_k It's quite simple, you click on the button and it…
Ambroise Rabier
  • 3,636
  • 3
  • 27
  • 38
1
vote
1 answer

Cant Figure Out how to get Unity UI to scale correctly

I am trying to get a health bar to display on my UI in Unity and cannot figure out how to get the scaling to work correctly. I need the Left most value to be 0 so when currenthealth=0 the bar disappears and when currenthealth = maxhealth it should…
Ethan Baxter
  • 196
  • 2
  • 14
1
vote
0 answers

How do i move the slider with GVR reticle pointer in Unity?

ExecuteEvents.Execute(gameObject, new PointerEventData(EventSystem.current), ExecuteEvents.pointerClickHandler); -is called when the reticle pointer is on the slider,but the slider position does not change. Then, if i click on my mouse, the slider…
1
vote
1 answer

RectTransform won't position

I'm trying to move a RectTransform, triggered when the UI object is clicked. When I set the position in Update, LateUpdate, or Animation, the RectTransform moves as expected. When I try to set position/anchoredPosition/etc. in the OnClick callback,…
Fiddles
  • 2,790
  • 1
  • 32
  • 35
1
vote
2 answers

Show input field above keyboard mobile

Common ux case on mobile is to have the view magically scrolling when keyboard shows up so that input field remains visible above keyboard Mobile sdks like Xamarin, ios or android would provide that functionality natively. Would there be such…
Everts
  • 10,408
  • 2
  • 34
  • 45
0
votes
0 answers

Is there a way to make every other row of a Grid Layout Group "indented"? (Unity 2D)

I am creating a health/stamina system in my Unity 2D game project, and I am trying to create a custom layout using the built in Grid/Horizontal/Vertical Layout Group components. The layout I am aiming to achieve will look similar to this…
0
votes
0 answers

How can I disable the method if there is a UI on top of the object?

The code below is triggered when the player clicks on the mouse button, if there was an object under the mouse, then the object changes its material private void Update() { if (ClickCheck(out var hit) && hit.transform.TryGetComponent(out…
0
votes
1 answer

Unity standard button not calling event with new input system (but it does change color)

I have an odd problem no one else seems to have encountered. I have some buttons in my game that do respond to clicks by changing color, but the functions added to the list of OnClick events do not get called. I have an event system with the new…
Dollarslice
  • 9,917
  • 22
  • 59
  • 87
0
votes
1 answer

Unity UI buttons are not being highlighted when the cursor hovers over them on the Quest 2

So I'm having an issue where Unity UI buttons are not being highlighted nor animated when the raycast is over them. It works fine in the Unity editor, but not when I build the apk to the quest 2. The clicks work fine, is when highlighted the…
0
votes
1 answer

Unity UI Toolkit - Unable to select child element

I am trying to select the highlighted element using the selector shown in the search box: #StateEvent > * > .unity-foldout__input But it doesn't seem to be able to find it - no search results found. And in code it is unable to be found too with the…
asker
  • 198
  • 2
  • 11
0
votes
0 answers

Unity2d Canvas - Multiple canvases in single scene not working

I am having some problems with canvases and UI elements in Unity 2d. I am trying to use a single scene, with multiple "screens" that will always be active and I just move the camera location to the correct place to view them. For example, the main…
user2779315
  • 49
  • 1
  • 1
  • 8
0
votes
0 answers

how can i make image in ui fill the panel

I am making an inventory for my game, but I can't make the slot and inventory background fit the entire plane without make the hit box stretched. cant really find any documentation on this so I dont know how to fix my problem. at first, I messed…
0
votes
0 answers

Unity game object keeps switching from being an object and "null"

SOLVED - 2 copies of the script in unity I'm working on UI that gets information from a web socket. I have run into a problem where code_object (and code_text) keeps switching from being assigned and null. (it also causes an…
0
votes
2 answers

How can I make the bottom button in a UI panel highlight the top button on down arrow?

I have three buttons on a pause menu. Resume is set as First Selected in the Event Manager. Options is in the middle, and Quit to Main Menu is last. If I press down arrow or D-pad down on a controller, each button highlights correctly, but stops at…
0
votes
0 answers

Unity On Click Listener not working after recompiling(due to script change)

Currently my code works perfectly fine(i have disabled a few things here to make it simple) when i enter playmode however whenever i make any changes to code(unrelated to anything in Button Manager) the script recompiles(as expected) but my buttons…