230 questions
-1
votes
1
answer
160
views
How to set UI Toolkit to World Space in Unity 6? 'Render Mode' option is missing in Panel Settings
I am using Unity version 6000.0.34f1 and I'm trying to create a World Space UI with the UI Toolkit.
According to the official Unity 6 documentation, this should be straightforward:
"To create a ...
1
vote
2
answers
37
views
In Unity Engine, if a child RectTransform has a different scale to its parent RectTransform, how to align their four corners?
Here is an example, the scale of the child RectTransform is 3, which caused 3 of the 4 corners to lose alignment.
Can this be enforced without wasting extra CPU cycles?
This problem is encountered ...
0
votes
0
answers
23
views
In Unity UI (uGUI), how to prevent the parent GameObject of a custom LayoutGroup from collapsing to size 0?
Assuming that I have a custom LayoutGroup implmentation:
public class DummyLayout : LayoutGroup, ILayoutSelfController
{
protected override void OnEnable()
{
base....
-4
votes
1
answer
169
views
Unity ScrollView — Vertical scrollbar always visible, horizontal scrollbar never works
I'm building a 2D level editor scene in Unity for my game, which includes custom width and height.
Setup
I have two text inputs where the user enters width and height.
Based on those inputs, I ...
0
votes
1
answer
129
views
Change the column header style in Unity's UI Toolkit MultiColumnListView
I am using a MultiColumnListView in Unity's UI Toolkit.
I would like to change the appearance of the colum header cells.
Right now this is how they look like.
I would like to remove the grey ...
0
votes
0
answers
115
views
Performance vs flexibility in a Unity Node Graph Editor Tool
I'm developing a node-based editor tool in Unity with pure UIToolkit (no existing graph frameworks). The premise is that the graph needs to be scene-based, so it's a Monobehaviour, rather than a ...
1
vote
1
answer
528
views
MissingReferenceException: The object of type 'UnityEngine.GameObject' has been destroyed but you are still trying to access it from EventSystem Unity
The Built-in eventsystem for unity UI keeps trying to access a button after I have used Destroy() on its gameobject. it stops and doesn't start again when I pause but will continue every frame ...
1
vote
1
answer
88
views
How to find active InputField, isFocused does not work
I am trying to find the active InputField.
In the code I create InputFields and add them to the list, in the list they are added, but I can't get them in isFocused. The main task is to compare the ...
-1
votes
2
answers
140
views
How to make Buttons interact immediately Unity UI?
So, if I press the button and hold it, the button will "wait" until I get my MouseCursor or Finger of the button and just then the button triggers the code. How to make so that the code will ...
-3
votes
1
answer
65
views
The Unity button does not respond
I am trying to develop a game in Unity. A respawn button is displayed on the GameOver screen. But it does not respond.
Unity interface with the button
Here is the image of the button in the Inspector
...
1
vote
0
answers
128
views
How to Remove White Rectangle in Unity 2D Game Scene?
I am a beginner in Unity 2D and currently learning how to make simple games. I'm encountering an issue where a white rectangle appears in the game scene. I am unsure of what is causing this and how to ...
0
votes
1
answer
64
views
Scale Background(SpriteRenderer) C#,Unity
When I change the resolution, the camera gets closer to the center and many objects are simply not visible.How can I fix this?screen with wrong sizes. correct size my gamesame problem on other scenes.
...
-2
votes
2
answers
490
views
'Button' does not contain a definition for 'onClick'
GameObject newButton = Instantiate(_buttonPrefab, _parentPrefab);
Button buttonOnClick = newButton.GetComponent<Button>();
buttonOnClick.onClick.AddListener(Testttttssad);
For some reason, ...
0
votes
2
answers
602
views
Unity button text not displayed
I have a problem with my unity project, when I insert a UI Canva and a button with text, the text not showed up,
I tried to increase the font size, the opacity, change the text color, every possible ...
2
votes
1
answer
373
views
Sort the layers of objects in a scrollview
I'm working on a personal project to make a website with the Unity UGUI.
I'm using a Scrollview which has a vertical layout group and a Content fitter component. It has several containers as children, ...
0
votes
2
answers
710
views
Variables not showing on inspector when I extend Unity UI button
Variables not showing on inspector when I extend Unity UI button.
I wanted to add some extra functionality to unity button, and to do this i just extaned this button and wanted to have 2 fields.
But ...
0
votes
1
answer
529
views
Using Unity UI Toolkit and New Input System together
l am using Unity UI Toolkit and New Input System.
My game logic is when l press left mouse button, object should start move. Also there is a power-up button in view, l created with UI Toolkit and ...
0
votes
0
answers
73
views
Text Mesh Pro texts do not appear in apk
While Text Mesh Pro, which I use in my Unity program, appears on the Editor Screen without any problems, when I build the apk and open it on my Android Device, the texts do not appear. Editor Screen
...
0
votes
2
answers
216
views
Blocking interaction with 3D game objects by UI game objects
I have some 3D objects, if I click on them then something happens. I implemented this using Physics ray casting like this
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
...
0
votes
1
answer
158
views
How to add buttons over 3D models for an AR app in Unity?
I am creating an AR medical encyclopedia as a starter project on Unity. However, I am unable to find any solutions for how I can add clickable buttons over a 3D model that are anchored to the model.
...
0
votes
1
answer
110
views
How to get value of transitionDuration in C# for Unity UI Toolkit
My existing code for this task is:
private VisualElement _creditSection;
private void Start()
{
var rootElement = uiDocument.rootVisualElement;
_creditSection = ...
1
vote
0
answers
251
views
Create following UI and Head-Lock UI in VR
GOAL
I imported Meta XR Integration package and Meta XR Simulator.
I want to follow and head-lock UI to Headset Camera.
CONTENT
I use Built-in and Unity2022.3.8f1. I am using Meta XR Integration 57.0.
...
-1
votes
1
answer
34
views
How do i display the text with the list i have stored ? It is not assigning in UI text ...?
here is the code
The part which is commented here is giving error when i play .
it isnot assigning in the ui tmp .
I tried using non canvas prefab for Cards , but i want it in ui only.
Sorry for not ...
0
votes
1
answer
483
views
Unity-Could someone explain how the onClick event works in unity 2022.3 and above
I'm working on the 2022.3.5f1 version of unity and its onClick event for buttons ask for parameters that I'm not familiar with. Could someone explain what I'm supposed to input for target assembly, ...
0
votes
2
answers
570
views
How to set interactable false when we click a button in unity
I don't want players to be able to click a button twice, so I'm trying to set the 'interactable' property of buttons to false when a player clicks on them. I don't want to individually define button ...
-1
votes
1
answer
190
views
How to change a sprite (ui.image.sprite) and delete the previous one from RAM
I need to take a screenshot of the screen and put it as a sprite in the image component.
I do it with this code:
public Texture2D TakeScreenshot()
{
Texture2D texture = new Texture2D(Screen.width, ...
1
vote
3
answers
964
views
Vertically scrollable UI with children that stretch to width
I am trying to create a vertically scrollable UI element that stretches horizontally, with children that also stretch horizontally. The children are instantiated prefabs. The prefab root object is set ...
1
vote
1
answer
539
views
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 ...
0
votes
1
answer
717
views
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 ...
0
votes
1
answer
625
views
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 ...
-1
votes
1
answer
162
views
Why isn't a Unity Canvas loading?
I tried to change it to Canvas, but it's still not going to the next scene/canvas.
I already added the RoomList in the building settings but still not going there.
It's not reaching the StartCoroutine(...
0
votes
0
answers
390
views
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 ...
1
vote
0
answers
100
views
Can not get the following UI (see Image) correctly in Unity Editor in World Space (LayoutGroup, LayoutElement, ContentSizeFitter, ...)
i know this might be a lot to ask, but unfortunately i can not get the following UI working in Unity. I experimented a lot with Content Size Fitter, Vertical and Horizontal Layout Groups and Layout ...
1
vote
0
answers
511
views
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 ...
0
votes
0
answers
79
views
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 ...
1
vote
0
answers
186
views
UnityEngine Can't Deserialize Sprite
i working on a save system for my game. Basically, i was using JsonUtilty for saving system but it didn't help me because i want to save a list with ScriptableObjects. I was saving and loading ...
0
votes
2
answers
233
views
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,...
-3
votes
2
answers
112
views
How do you convert a string to ASCII Binary?
I'm working on a unity project and need to convert an string input by the user to ASCII binary. To my knowledge this is the way to do that:
using System.Collections;
using System.Collections.Generic;
...
0
votes
1
answer
134
views
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 ...
-1
votes
1
answer
126
views
Memory Card Puzzle In Unity Giving Me An Error After Clicking A Button(Fix?)
I'm making a memory puzzle in unity, but I get an error when I click on a button. It is supposed to show me an image that is tied to the button, then I click another button. If it is the same thing, ...
1
vote
1
answer
418
views
Responsive Game View - Game View Is Not Same At Different Screen Resolutions
I need your information! I'm cloning the game called Toon Blast to improve myself. In the picture below, you can see 2 screenshots from the original game on the left, and 2 screenshots from my own ...
0
votes
1
answer
101
views
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.
...
0
votes
2
answers
3k
views
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 ...
-1
votes
3
answers
2k
views
Unity UI panel transparency
I'm working on my game and I want to add an inventory type system, when I added the panel it was a little transparent while the one in the video was watching was not. I didn’t see any setting for ...
-1
votes
1
answer
198
views
Unity - UI is in different location in build than in the editor
I have UI of a gun that I keep in the right-bottom of the screen, and properly stays there when i run in edit mode, but for some reason when i build it, it snaps to the left side. I have the UI set to ...
1
vote
1
answer
453
views
Lightning and display issues with Unity CanvasRenderer
My goal is to draw simple, colored meshes on a Canvas in Unity. I set up a Canvas and chose Render Mode World Space. I then added a GameObject, set its RectTransform, added a CanvasRenderer (later ...
0
votes
0
answers
926
views
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()
{
...
-1
votes
1
answer
450
views
Spawned Unity UI Grid Layout child object is not correct size
I am using unity grid layout component but not working correctly.
I am using unity grid layout component grid layout values. When I drag and drop my prefab as a child of grid layout object is ...
-2
votes
1
answer
197
views
How De-serialize response JSON with dynamic keys?
I know that this question is asked many times but still I'm struggling to understand this. I have below json to c# converted class.
// Root myDeserializedClass = JsonConvert.DeserializeObject<Root&...
0
votes
0
answers
122
views
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 ...