All Questions
731 questions
0
votes
0
answers
42
views
Use references to UIManager script or direct for children OBJs
So I've got a canvas with UIManager script attached to it, the canvas has a lot of buttons and texts as children OBJs and they somehow need to communicate to each other. Should this be done through ...
1
vote
1
answer
310
views
Counter won't add to score [closed]
I'm trying to make a rolling ball game. But for some reason, I can't seem to get the counter to actually add to the score. Here's the code:
...
0
votes
0
answers
15
views
NullReferenceException: Object reference not set to an instance of an object [duplicate]
Hi so im displaying food, health an water on the screen in a text box by using UnityEngine.UI and making text variables. They are all defined in the update function so they will keep changing and are ...
1
vote
1
answer
479
views
Why Unity3D 2018 UI looks bad and very sharpy?
I update my project from Unity 2017.1.1 to 2018.3.9 and almost everything is OK except UIs.
All of UIs like Images,Buttons,texts,text mesh pro, sprites and others looks very sharpy and pixel pixel ...
...
0
votes
1
answer
1k
views
Unity Canvas hover image does not trigger event
So i have the following setup:
This produces the following UI:
Now on each of the "HudCircle"(Bottom/Right/Left/Top), I have the following components:
As you can see I have a script that has the ...
0
votes
0
answers
1k
views
Simple shader that scales UI image from the center
I'm having trouble making a (vertex) shader that scales UI images from the center.
I can scale the image, but the image doesn't stay centered.
Here is a project showing the problem
Here is a ...
2
votes
2
answers
1k
views
Preventing the mouse from breaking keyboard navigation in UI?
I am trying to achieve the following, a behavior like Windows Explorer where mouse and keyboard play nice together.
Here's a GIF along explanations:
first I click one of the folders using the mouse
...
1
vote
1
answer
711
views
Changing text occurs error: move initialization code to the Awake or Start function
I have GameManager class that has Log method:
...
0
votes
0
answers
70
views
Issue with button clicked by mouse? [duplicate]
I have panel with some images and buttons. when I click on a button with "gold" name it works, and if I click on any thing other I got error //NullReferenceException: Object reference not set to an ...
1
vote
0
answers
222
views
How can I approach writing a GUI framework for my game? [closed]
The problem
I want to write a simple GUI framework designed for a game, in order to learn the inner workings and nitty-gritty of how GUI 'engines' such as Unity3D's GUI work. I can't find any ...
1
vote
1
answer
26
views
Identify button from script?
I want from my script to change the color of the button that identify from the Function OnClick. It's possible ?
...
0
votes
2
answers
744
views
Moving panel between two positions smoothly?
I'm trying to make my panel moving from one position to another one smoothly. What I get is more faster no matter what I did to make it slower never get slow !! Both Vector3.Lerp and Vector3....
1
vote
0
answers
2k
views
Using Unity Post Processing v2, how can I apply processing effects to just the UI?
I am using Unity 2018.3 with HDRP 4.9, and Post Processing 2.1.3.
I would like to apply post processing effects (i.e bloom) to the UI only.
I tried the 2 camera approach, but still can't get it ...
0
votes
1
answer
486
views
Technical term for the border that appears around the screen, usually in response to low health?
This had a strange term but I can't remember what it's called and it's difficult to search for.
0
votes
2
answers
4k
views
JavaFX - How do I create a health bar?
I tried searching online on how to implement health bar with Java FX in a 2D side-view Java fighting game but I can only find those that goes with 'awt' and 'Swing'.
The health bar I'm picturing are ...
3
votes
1
answer
680
views
Create context menu in Scene view
I created some MenuItemfunctions for navigating, which are currently displayed on the menu toolbar. The C# code:
...
0
votes
0
answers
324
views
how do I instantiate a prefab that adds to the score text in c#?
Hello I'm working on a game with random generation, a dungeon crawler of sorts. i need to be able to have an object that when instantiated, adds to the score(the goal is to find all of them as the ...
1
vote
0
answers
1k
views
How to zoom image on Unity UI to particular point where mouse cursor is located?
I have some RectTransform on Unity UI. I have already implemented some Zoom functionality but now I need it to zoom to the area where the mouse cursor is located. Currently, it zooms to the anchor ...
2
votes
1
answer
1k
views
UI/Menu that works with and without VR (Unity, WMR)
I'm working on an app that I want to be useable without and with VR (with a Windows Mixed Reality HMD like the Samsung Odyssey).
For non-VR I'm simply using a canvas in "Screen Space - Camera" and a ...
0
votes
1
answer
41
views
Rewriting a text object [duplicate]
I'm trying to set up a UI system. Say I have a text object 'text' which is visible onscreen. I want to change it with a button press using a script such that the text box's previous string is replaced ...
0
votes
1
answer
3k
views
Unity UI Buttons don't work when clicked, don't seem intractable at all
This is probably a quick and easy fix but I can't seem to get it.
As the title says I've got UI buttons which appear when my character dies, they used to work just fine but now suddenly when doing a ...
0
votes
1
answer
373
views
Why is this LIBGDX Action behavior THE EXACT OPPOSITE of what I expect?
Here is a code snippet of the relevant section in my render loop. My intention was to make the actor who was currently focused blinking, to indicate that it was the currently selected UI element. But ...
1
vote
0
answers
29
views
How to attach an UI button to a prefab and follow it in Unity2D
My plan is creating a button above my prefab (a tree) and whenever my character is detected, the button will appear and allow me to click on it to active a dialog. I just want my trees are randomly ...
0
votes
2
answers
145
views
Error in DRAW GUI event on android. (GameMaker)
Image of the game on a mobile phone:
As you can see the maze (draw event) has been resized correctly.
But the yellow post-it (draw GUI event) has not been scaled or displayed in the correct location ...
1
vote
0
answers
739
views
How to sort cards' on-screen positions by their suit?
I have a 13 cards and sort button.
When I click that button, I want all the cards of each suit to be grouped-together on screen. So if I have 4 diamond cards in my 13-card hand, all 4 diamonds must ...
0
votes
1
answer
225
views
Make Unity GUI for mobile phones only?
I'm using Unity and I want to make a responsive GUI for portrait resolution only. Now I'd like to know if this is a good or bad idea when I force the user to play my game in portrait mode only. Shall ...
0
votes
1
answer
3k
views
Unity - Button still interactable even when interactable is set to false
my button can still be pressed in-game even if I set it to button.interactable = false;
What I'm trying to achieve is when the Panel ...
0
votes
0
answers
2k
views
Blurry text in Unity UI at default scale
I'm working on a VR (GoogleVR Cardboard) game, and need to include UI elements within it.
Ever since I first learned how to use Unity's UI elements, I've been limping around what seems to be a major ...
0
votes
1
answer
81
views
Contracting Unity EditorWindow UI
How can I make scalable(contracting) EditorWindow UI(not in-game UI) like in inspector example?
0
votes
1
answer
686
views
Trying to mix and mingle 3d physics with the Unity UI
I have recently created a drag drop system where I drag stuff from a UI menu and then drop it to another UI. The child of the draggable UI object is a 3d model. I have attached box collider and ...
0
votes
1
answer
2k
views
"SetSelectedGameobject" only highlights button on second try (Unity 2017.3)
To support the use of a gamepad in the options menu I set SetSelectedGameObject and firstSelectedGameObject (which doesn't seem ...
0
votes
2
answers
224
views
How can I make the cursor avoid something completely?
I wrote some code for a UI button that causes the mouse to avoid it. I realize this is kind of a weird thing to do in a game design-wise, but this is a really weird game. I need a button that is not ...
3
votes
0
answers
337
views
Quest UI Display in Unity 2D
I have this quest manager script where I store all my quests for easy duplication.
I'm adding a feature that gives the player the option to see his/her current to-do quest.
The first thing I ...
1
vote
1
answer
2k
views
Blurry UI when using Screen Space Camera
I am using Screen-Space Camera as a render mode on canvas but the Textmeshpro text and other UI elements are looking blurry around edges. I think it might be due to canvas scaler setting. After ...
0
votes
1
answer
276
views
Does a successful attempt count as an attempt?
I'm writing a video game and I'd like to know if I should include the "successful" attempt in the count of "total attempts".
For instance, in a clay shooting game, if the player needs four shots ...
0
votes
2
answers
2k
views
Unity 3d texture animated round circular bar
I'm struggling to create a circular bar with an animated texture and a round cap end. What I would like to create is implemented in the Unity game Subnautica - the bottom left bar. So here is the HUD ...
0
votes
1
answer
48
views
Unable to add button in Unity
I am wanting to add a button to my scene in order to mute/unmute music. I can add the button to my scene, but it's not appearing on the UI. I can't see it anywhere, not on the scene nor the game ...
0
votes
1
answer
880
views
How to clip what is outside scroll view when using a custom UI element?
I have created a custom UI element (that use CanvasRenderer).
Here is code :
...
0
votes
1
answer
600
views
Trigger the button's onclick after checking that the cursor has been on it for some time
I would like to have the mouse hover/click the button for a fixed amount of time (5 seconds) before triggering the onclick method, it can click only after they have ...
3
votes
0
answers
1k
views
Create a curved UI [closed]
I am new and Unity and I want to do a curved UI as if I project a canvas on a cylinder, a bit like this : picture
Thing is, it is not that easy. I found this question and answer, but didn't manage to ...
0
votes
0
answers
502
views
Unity WorldToViewportPoint not giving correct results
I have a script that places an UI element on the place where a 3d object is in 3d space. I do this in the following way:
...
1
vote
2
answers
3k
views
How can I outline text in Unity?
Since it generates more triangles and vertices, the official outline script isn't a good way to do text outlining in my project.
How can I outline my text, with better performance?
TextMesh Pro may ...
1
vote
0
answers
134
views
How can I render 3d objects over uGUI?
I have a scene with 3d objects but need uGUI as background.
How can I achieve this?
0
votes
1
answer
66
views
jMonkeyEngine ignores keyboard input
Created a game login form using the Nifty GUI. The interface reacts to the movement and clicking of the mouse, but ignores the input in the text fields. Whether the program is looking for a click ...
2
votes
1
answer
562
views
Decouple GUI from Logic
I don't have an educational background in the programming-world; however, I've been working on a programm in my spare time for the last two years.
I'm currently struggling with how to decouple the ...
2
votes
0
answers
860
views
Why doesn't the Camera.pixel(Height/Width) match the Canvas size?
I am making an app that has a custom viewport Rect like so:
When I check the sizes of this viewport rectangle in pixels with Camera.pixelHeight; Camera.pixelWidth,...
0
votes
1
answer
660
views
Unity - Raw Image Size scaled to Photoshop
I'm just a beginner in Unity, so basically, I want to find out the exact measurement unity of the raw image so that I can now design in photoshop. I tried in Pixels in photoshop but when I import it ...
0
votes
0
answers
2k
views
2.5D UI, perspecitve view, distort objects by angle but not position
Instead of thousand words, a few pictures to explain what I want to achieve
How do I get the merit of UI objects rotation in perspective projection, but ignore the position of an object(as in Overlay ...
1
vote
1
answer
760
views
My Canvas has an image which I am using for my background but it is blocking my Camera from seeing my Game Scene
So I am not entirely sure how to explain this as I have not had any luck searching online and I'm sure this is a simple problem but I'm being stupid and can't see it.
I have a Canvas which is for my ...
0
votes
1
answer
58
views
unity UI limitation for tutorial purpose
i want to add a tutorial part to my game that i make by unity.i have some panels that for tutorial purpose i want to limit user to just click a button.most of games make a dark panel over all places ...