Questions tagged [unity3d-gui]

Questions related to the new UI system in Unity 4.6 and newer or the old GUI class.

Useful links:

134 questions
0
votes
2 answers

Unity2D C# Reloading progress bar not working propertly

So I'm making a top-down tank shooter game and I want to make a better reloading system than it was before. So I came to the idea that I need some king of progress bar. I knew how to make it so I started doing it. The problem is that it doesn't…
0
votes
1 answer

Editing text causes unity to crash

What happened When trying to change the text of a button or text, unity editor crashes. How we can reproduce it using the example you attached Create a new project. Add Text (GameObject->UI->Text) Crash occurs when you click to change the…
Johan Claes
  • 139
  • 2
  • 14
0
votes
1 answer

Unity 4.6+: How to disable/enable GUI panel with a UI button by script

I am just starting with unity and having problems to show/hide menu panel with a button click. I am using unity 5 and able to do it by playing On Click() button parameter right in the inspector: I click "+", drag my panel in object field, and the…
Acidon
  • 1,294
  • 4
  • 23
  • 44
0
votes
1 answer

Generate GameObjects and set their image from an Array of Textures when a button is clicked - Unity 4.6 (using uGUI)

I'm having a lot of trouble trying to develop a loader that when a button gets clicked it takes an array of textures and populates them into a grid layout (and when another button is clicked it removes the current textures and replaces them with a…
greyBow
  • 1,298
  • 3
  • 28
  • 62
0
votes
2 answers

Detecting which UI button was pressed within canvas?

I have like 10 buttons on my UI and I gotta check which one was touched. I was using the following logic and it was working fine, but now I am getting this error for some reason: NullReferenceException: Object reference not set to an instance of an…
Diego Fortes
  • 8,830
  • 3
  • 32
  • 42
0
votes
1 answer

EditorGUILayout.Popup option is not changing

using this simple code I'm showing a dropdown int selected = 0; ///* string[] options = new string[] { "Start With", "End With", "Contains", }; //criteria =…
Mohammad Faizan khan
  • 1,213
  • 3
  • 17
  • 32
0
votes
2 answers

A pause menu using a button and click

I'd like to know how I can pause and unpause menu from the same button using the mouse pointer when I click on it. Lets say I have this. C# void Update () { if (Button_Pause.OnPointerClick()) { if(!active){ PauseGame(); …
Sean Sabe
  • 79
  • 9
0
votes
1 answer

Animation not working in game as it is in the scene view

I'm trying to make an animation where the word contained in the middle of the screen has its letters that get highlighted one by one using an image overlay on which I increase the alpha from 0 to 0.5 over a short period. My problem is, even though…
Geoffrey H
  • 1,280
  • 2
  • 10
  • 33
0
votes
1 answer

Unity Canvas Doesn't Show on Device

Working on a Unity App, and trying to make a basic Menu Screen. I run Unity 5.0.1p3. Although irrelevant, this might be important: My app uses Vuforia, and thge other scenes have no problem. So, when I try to create a Menu Screen using the default…
Augmented Jacob
  • 1,567
  • 19
  • 45
0
votes
1 answer

How to line-break buttons using Unity 3D New UI

I'm not familiar with Unity's new UI system of 4.6 and later. I would like to display a series of buttons on screen and have them center-aligned and breaks into the next line when screen width is reached. The old OnGUI function no longer seem…
Yangrui
  • 1,217
  • 2
  • 17
  • 41
0
votes
1 answer

Unity3d UI events not working on iOS device

I'm developing iOS & Android game using Unity 4.6.4. My UI stuff works well on Android devices. However, on iOS devices UI appearance is OK but they're not working properly. Button onClick events are not working, button animations work though - that…
Dilara Albayrak
  • 314
  • 1
  • 3
  • 23
0
votes
2 answers

Display Player Coordinates on Simple GUIText

Novice here - of course. I'm using Unity 5, and am looking to display on screen the coordinates of a player using a FPS camera. The main reason is I'm using a camera path animator to fly around a terrain scene I built for class, and think by logging…
theProject
  • 145
  • 3
  • 16
0
votes
2 answers

Working with multiple gameobjects

I have the requirement to Hide and Show the specific gameobjects on specific button click. Button-1:- gameobject[0].SetActive(false); gameobject[1].SetActive(false); gameobject[2].SetActive(false); gameobject[3].SetActive(true); …
0
votes
1 answer

Unity 5 fix Listener calls

I'm have problems using runtime-generated buttons in Unity 5. Buttons are created correctly, but i have some problem with the listeners. I use this code to create buttons: foreach (string str in _scene.PDF_ITEMS) { button =…
A.Mattia
  • 56
  • 5
0
votes
0 answers

Issue with Unity3D Canvas PixelPerfect, LayoutGroup and ScrollRect

When the scene like below, the ScrollRect has no problem. Canvas (Pixel Perfect toggle off) --| ScrollRect ( ScrollRect + HorizontalLayoutGroup ) ----| Content ----| Scrollbar But when Pixel Perfect toggle of Canvas is on, the ScrollRect is not…
Matrix Bai
  • 1,097
  • 3
  • 11
  • 20
1 2 3
8
9