#📲┃ui-ux

1 messages · Page 7 of 1

nimble stirrup
nimble orbit
#

@mortal robin I did eventually fix my raycasting issue, it was a rendering problem of all things

#

BUT

#

...No Button object on the UI element is clickable, neither is my IPointerClickHandler being fired

nimble orbit
#

Now I can't click on a TMP input field in world space

#

Clicking on buttons works fine, but I can't focus an input field

crimson owl
#

Is it true that it's better to code your UI animations?

#

rather than use Unity's In-built animation tools

crimson owl
#

honestly probably should have already known

jagged monolith
#

I use DoTween for animation like this and it works great

primal leaf
#

Does anyone have working blur in URP when there is sprites and other UI in background? I need it to work like frosted glass, Seems things work if there is 3D object behind it but not when there is sprite or other UI.

bitter cobalt
#

hey, any reason why a Pointer click event trigger stopped working after I added the related gameobject into a grid layout group?

jagged monolith
bitter cobalt
nimble orbit
#

Anyone know how to get a TMP Input Field working on a world-space canvas? I can't seem to get it to receive pointer events OR get keyboard focus

#

But if I place a Button, or add a script that implements IPointerClickHandler, I do get pointer events on that. So I know my event system and graphic raycaster are working properly

wide locust
#

Do you now why the color go on the text above?

mortal robin
wide locust
cursive jasper
#

I'm having issues with a scrollbar ive setup and I've followed a few guides all the way through and I am not sure what's going on, but despite the icons existing in the scene editor they won't actually show up in the simulation, and they do have sprite renders, and I think the layering seems to be fine, so I'm stumped

cursive jasper
#

Ok scratch that it's probably something with the layers and following more guides and forum posts has got me more lost

#

here image of test

errant brook
#

My UI isn't showing up on my camera, here's my setup

jagged monolith
#

There are some fundamentals you should know when working with unity UI so I'd recommend finding a tutorial video on that

errant brook
#

Got it, thanks!!

twilit kayak
#

I have a problem with the canvas , i'm trying to make a simple pause menu, but whenever i switch the game view, the canvas stays at the right side of the screen

mortal robin
twilit kayak
#

It always looks like this

mild kernel
#

Because you're using a screen space canvas. What do you want it to look like?

low pike
#

Don't develop UI with the game view set to 'Free Aspect'

mortal robin
twilit kayak
#

I already fixed it

neon terrace
#

is there a ui component similar to this? you use the arrows (or arrow keys) to scroll through different options

#

dropdown isn't exactly what i need as i dont want a huge list to plop up

#

or do i simply just add a text field, 2 buttons and then increment or decrement an int that will in turn change the current element in an array that displays the text?

neon terrace
#

👍 gotcha

dusky vault
#

How do i add selectables for the drop down button?

#

Add all the options

#

Right now its just blank

dusky vault
#

It should show options here

deft vigil
#

How can I make ui fix for the screen size?

slender epoch
#

Hello. I have an Image UI game object. The Source image is a Texture Type Sprite. Somehow I automatically have a box2D collider by default and I cannot turn this off. How to delete or remove this box2D collider? This is definitely a collider, I have tested it.

mortal robin
runic dock
#

i have a text mesh pro and im getting this weird box around the letters with bright colors on the text. anyone knows what is causing this?

#

i think it was because it was set to bold

wide locust
#

The letters are highlighted?

#

I thinks it's for this the box around your letter

slender epoch
queen yarrow
#

How can i disable this option? I don't want that a button stays selected

#

It makes the buttons buggy, per code or per unity, how to disable this?

rapid ferry
queen yarrow
novel stag
#

how do i anchor a object to the left and also let it stretch at the same time

tacit steppe
#

my prefabs are larger than the resolution I have set and it's throwing off the UI. Is there a way to make prefabs have the same resolution that the main canvas has?

mortal robin
queen yarrow
wind wigeon
#

Would anyone here know why the hitbox for clicking is much bigger than the actual button component in my scene?

#

i.e. i click credits even when im way off of it, the border extends all the way to even overlap plays button

#

I colored the border of the button just to show that its not that, or atleast thats what I would assume, idk whats happening here

pliant saddle
#

Hello. I have an issue with UI. When I turn on Anti aliasing all UI in my game view disappears. Have anybody encounter with this problem. Any help and ideas will be appreciated.

dense iron
#

Howw'd you guys implement a map panel containing nodes(cities) and edges(roads) and each time a player wins a mini game the appropriarte city changes color?

next moth
#

Hi, anyone here uses Doozy?
I'm trying to create my first flow graph but I can't edit nodes in the inspector, everything is greyed out.

#

Same thing goes for nodes from the examples.

#

Is this because I got the free version?

toxic pasture
#

i dont know key words to google it

jagged monolith
vernal granite
#

hi there
how do you guys handle controller navigation on a grid layout?

queen yarrow
#

Anyone knows this issue and the fix?

low pike
#

not from that info
is it a world space canvas?

queen yarrow
#

tsf.position = obg.localPosition + new Vector3(0, (float)0.5, 0);

#

The Text is how you see, parented to the Panel, a Cube

#

Since with local position it would be somewhere in the sky, i needed to use position to get it over a not Canvas object. tsf is the Blue panel

low pike
#

you don't move UI elements around with .position

#

but with your answer, it sounds like you don't understand what I asked

queen yarrow
#

Oh yea

#

That's my mode

low pike
#

When moving a World Space canvas around, you'll move the transform around. But, no matter the canvas render mode, you move the UI elements around with the RectTransform

#

transform.postion != UI positions

low pike
queen yarrow
#

Yeah

low pike
#

Don't put 3d objects on a canvas like this

queen yarrow
low pike
#

If you just want text on the cube, use the 3d TMP - which doesn't require a canvas

#

If you want more than just text, then use a world space canvas, as a child of the cube, and size it correctly

#

for non-canvas TMP

queen yarrow
#

oh wait, there is Text mesh with tmp too?

#

Sorry, im new with Tmp

#

It got replaced, i see

#

I'll try out quick

queen yarrow
fast geyser
mortal robin
fast geyser
#

I can provide any more info needed

#

i fixed it, i just basically had to set the scale in the script file

sweet heath
#

There is a way to check if the Image is visible? I'm using a Mask for minimap, i have like 400 icons on the map and i want to run some code only to the visible icons.

wispy furnace
#

My text is supposed to appear when I build and run the code but it doesnt show

#

when I run it like this, it shows

#

@low pike?

#

This is how it looks from the scene

frank osprey
#

When editing UI, think as if the objects in the world didn't exist, and vice-versa.
It's just how Unity renders your Canvas so it's visible for you to edit. Once in play mode, it will adapt to your camera size.

#

It's completely normal that it appears so large

fossil prism
wispy furnace
#

is it like this

#

which one would my canvas need to be

frank osprey
#

No, you should not change that

fossil prism
#

you onlly do that when you want UI on world objects

#

not your usecase

wispy furnace
#

How do I make it so that the UI shows when I build and run

frank osprey
#

Anchor them properly

#

Let's take an example

fossil prism
frank osprey
#

Select your EXP counter there and show its Inspector

low pike
#

That's so anchored to the center instead of the top

wispy furnace
low pike
#

Press T

fossil prism
#

if you don't put it to scale with screen all this anchoring is pointless.

wispy furnace
fossil prism
#

ok good

wispy furnace
frank osprey
# wispy furnace

Yep see the square that says "middle center" at the top-left of your Rect Transform?
This means "position the object relative to the screen's center point"

fossil prism
#

and they will stick correct

frank osprey
#

You need to tell it to position relative to the top-left for the HP bar, top-right for EXP, and top-center for level

#

Click the square icon and it'll show presets

fossil prism
#

this ^^
Holding Alt when you do that will also snap it correctly in position

wispy furnace
#

so since my exp is on the right

frank osprey
#

You'd want it to stay on the top-right corner whatever the screen resolution is, right?

wispy furnace
#

do I have to just readjust the sizes now

frank osprey
#

Yes

#

Anchoring looks good now, seeing the 4-triangle icons

wispy furnace
#

Im going to run it now

wispy furnace
wispy furnace
frank osprey
#

You can test it out quickly by entering play mode and resizing the window. It'll adapt the UI if set up correctly, no need to waste time making a build

wispy furnace
fossil prism
fossil prism
#

you can scale it like a regular gameobject

#

rotate it

#

etc

wispy furnace
#

oh

frank osprey
#

You use it if you need to put UI objects at a specific position in the world. Think digital wall-mounted clock or computer screen

low pike
#

When working with UI , press T to work with the UI tools

low pike
# wispy furnace

change the reference resolution to whatever resolution the game window was in when you first made this UI

#

2560x1440

meager quartz
#

reckon this is a usable layout for UI for a bestiary/compendium sort of thing

#

i feel like maybe its overcomplicating it
maybe i just cut out the regions entirely

daring sky
#

hi there
does anyone know a way to determine child placement in a grid layout group?
like determining which child is above, left, or right, etc to the current one

thick sundial
#

Hi there.

#

@low pike

low pike
#

I don't know without putting it together myself and working it out.. which I'm not gonna do.
Post the question and relevant screenshots, someone else might know off the top of their head.

glass cloud
undone lichen
#

if i have a button with negative space at the edge, but I don't want this space to cause a button click if clicked on, can I change the buttons clickable area?

finite abyss
#

need help! i have a grid layout with a bunch of buttons. unity has highlighted, selected and pressed states for buttons but it seems like when im using a keyboard or controller to navigate it completely ignores the highlighted state of a button. how can i keep a button highlighted that was last selected with a controller or keyboard?? i cant find a solution

mortal robin
#

can you share a little more details about your issue?

#

Are you using a mouse and keyboard/controller at the same time?

finite abyss
#

hey no i dont want to use the mouse at all but the navigation is completely different for mouse and gamepad/controller. when i click a button with the mouse and move to another it keeps that highlighted state and the button stays looking highlighted too. with gamepad it does not do that. i have images for selected,highlighted,pressed,disabled.... but it seems like the gamepad instantly switches the button to pressed state just by navigating to it

#

so the last pressed button will never be highlighted

#

and there is no selected state

#

its very weird. most people when i was searching for a solution want to have that keyboard behaviour when using the mouse ,too. and i want it the other way around 😄

#

here im using the mouse first and then switch to gamepad. you can see the difference

mortal robin
# finite abyss hey no i dont want to use the mouse at all but the navigation is completely diff...

when i click a button with the mouse and move to another it keeps that highlighted state and the button stays looking highlighted too
No the mouse will cause the button to show the "highlighted" color. Which is not even a thing when it comes to joystick/keyboard

Joystick/Keyboard will actually select the new button and deselect the old. This is actual UI navigation in action

so the last pressed button will never be highlighted
Correct, if you want this behavior you'll have to create it yourself

finite abyss
#

okay :/ i slowly understand whats going on.i think i need to make a custom mouse pointer or something. thanks

celest lodge
#

this is my button script

#

why doesnt it change to the pressed button sprite?

high osprey
#

@rapid ferry These are the sizes of children, and the size parent (before and after applying the content size fitter, this is after actually)

#

The reason you cant see the children below the "screen" is because there is a mask, but they are indeed there, just invisible

high osprey
#

inspector of child (theres also rect transform)

#

and this is the parent

#

¯_(ツ)_/¯

rapid ferry
high osprey
#

i cant find it honestly

#

unity is just lying

#

what is child force expand?

rapid ferry
#

that is actually fitter already btw, what else do you need to do with them?

high osprey
#

ummm, well i need to adjust the size of a parent to be this (u made it yellow) size, so that then it adjusts itself to the scroll, since the parent ("CharactersButtons") is the content of the scroll

rapid ferry
#

then adjust that

high osprey
#

well, i cant really do that

#

there is this one thing, called Character Line
and that breaks this entire idea

#

its this object

#

and i dont think it will work in the grid

rapid ferry
#

oh I see, yeah that would ruin the whole thing

#

I am thinking of using separate verti and hori layout group, but that is kind of hard to maneuver

#

want to do it?

high osprey
#

ummmh idk how to really

rapid ferry
#

ill tell you step by step

high osprey
#

alright

rapid ferry
#

okay, right click the charbuttons, add empty

high osprey
#

i already got lost lol, charbuttons u mean the parent right? CharacterButtons?

rapid ferry
#

then add verti group

high osprey
#

and add empty gameobject?

rapid ferry
#

the ChracterButtons gameobject lol, you name it that way

high osprey
#

yeye

#

and im adding an empty child gameobject to it?

rapid ferry
#

yes

high osprey
#

alright

#

ok whats next

mortal robin
#

by overriding button you're removing the normal behavior

celest lodge
#

never mind i figured it out, thank you!

inland cobalt
#

Hello guys!
I need some help with the UI implementation
I have an element that is a part of vertical layout group, and that element has to be expandable, when I press button, it reveals additional options

How can I implement that extendable element?

Here are the screenshots:

dense iron
#

Whay does TMP not showing all the greek letter of the alphabet? What settings do I need here?

rapid ferry
#

do you guys have an idea how to do a ui looking like this with this kind of 3d distortion

#

like a futuristif hud

#

or just give me some keyword so that I search how it's called

#

please

#

yeah something like this

runic dock
#

so im trying to make some ui automatically get the height of a text mesh pro, but it seems like the TextMeshProUGUI.textInfo.lineCount is inconsistant. Sometimes it says 4, when its actually 5. and 6 when its 10. and other times it says 4 when its 10+. though somehow its consistant to what it gives me, it just does not make any sense to me. anyone knows what is going on here?

#

the only logical thing i can think of is that it only counts the lines within the bounds of the text. but idk why it would do that and not count all lines

low pike
#

Is there a reason you're not using the content size fitter component?

runic dock
#

uh, didnt know that was a thing

dense iron
#

What's the difference between an Image and a Panel?

jagged monolith
#

The only difference is the preset values in the Rect Transform

low pike
#

And the Image component on a Panel has a source image auto applied

queen yarrow
#

Now back with a similar issue again. The "Use Hotkey" a UI Image(Using because the Transparency on the Sprite), doesn't show up on the game view, like the last time i put the mesh cube and the TMP as child of the mesh cube into the canvas and moved them together. The Image has a Fake Parent script attached, means i can use it like it would be the child of the Cube(the Blue background).

Now there are things that got thought my mind:

1.There is a problem with moving UI Elements around, because the UI is relative to the screen(Makes sense i think because the Canvas has a Area to put the UI Elements in, if they are out of that Area, they are out of Screen)

2.I need to use a Mesh Cube again, but i don't know how to keep the transparency of the Image/Sprite, so the Corners stays like it should

3.There are other and/or better methods for doing this

#

Ignore the fact that i attached 2 Fake Child scripts, fixed now(This isn't a solution to the problem, just to not get confused by that)

trail oar
#

In a VR app I have a pop-up UI menu with buttons and a couple of check boxes. The right-hand primary button enables and disables the menu. When visible I can of course click the buttons and check a box but... (this is funny) when I toggle the UI menu closed and then open again the last element is clicked again.

So if it was a checkbox that I turned off, when I close the menu and reopen it, it toggles it and it is on again. If the last item was a button (like Play) then it presses Play again.

Any ideas what I've missed and/or how to stop the behavior?

thorn zinc
#

thoughts on a "Confused" status icon?

#

I do like having the halo but seeing them side by side it's a little busy compared to the other one.

peak notch
#

what if you removed the bottom question mark

coral violet
#

Hello, I am trying to instantiate one of my UI gameObjects in another UI window. The corresponding code that I use to instantiate is the following:

public void InstantiateSelectAchievement(GameObject selectAchievementGameObject)
{
GameObject gameObject = Instantiate(selectAchievementGameObject, AchievementParent.transform.position, Quaternion.identity);
gameObject.transform.SetParent(AchievementParent.transform);
gameObject.GetComponent<RectTransform>().sizeDelta = selectAchievementGameObject.GetComponent<RectTransform>().sizeDelta;
gameObject.GetComponent<Button>().enabled = false;
}```
The original UI gameObject (selectAchievementGameObject in the code) is shown in picture 1 and it is a child of a layout group, shown in picture 2. AchievementParent is shown in picture 3. However when I try to instantiate my gameObject the width of the UI is 0 (like shown in picture 4) and I have no idea why. Help would be very much appreciated thanks in advance 🙂
nimble orbit
#

I have a selectable Window object in my scene (actually, several). And each window may have child selectables on it (for example, input fields and buttons)

#

Is it possible to detect, on the window, when any child selectables are selected?

#

I wanna make the window look focus when it or a child is selected, and make it look unfocused otherwise

stoic hill
# rapid ferry do you guys have an idea how to do a ui looking like this with this kind of 3d d...

In this video we're going to take a look at Camera Stacking with the Universal Render Pipeline, in short URP, using Unity! Using Camera Stacking you can layer game UI in Unity very quickly, and author high quality user experience.

Download the Cockpit demo, along with other URP example projects here!
https://on.unity.com/3jUFeQm

More info on...

▶ Play video
snow shuttle
#

would anyone know how to solve this issue, i want to center this image (the basic tower) no matter how many children there are in the outer panel

#

trying to make it so if I duplicate the tower image it automatically centers everything

#

I'm just switching from Godot so I don't know how to do this exactly

#

oh I figured it out

snow shuttle
#

the MainUIContainer is blocking the buttons in its children

mortal robin
#

you don't need it to be clickable right?

snow shuttle
#

I don't need it to be clickable, just tried to turn it off but it still didn't work

#

it still says I'm hovering over it

#

oh shoot sorry it didn't uncheck

#

okay so now it's not showing me as hovering over anything lol

#

OH my bad I figured it out

#

one of the things was randomly not Raycast Targetable

#

thanks for the help <3

glass cloud
late solstice
#

Hi anyone know why my sprite are begin imported as Default Asset instead ofTexture2D?

low pike
late solstice
late solstice
#

Hi guys. Is there a way I can use dds as UI instead of .png?

low pike
#

never heard of dds, there won't be built in support for it

late solstice
#

Right now the dds is working more like a texuture but i want it to work like the "Exit Game" button which is just png

#

i guess there is no way to fix it 😦

indigo dew
#

in UI builder how to set on hover animation: background-colour of button changes like it's filling from left? Also scrolling text animation for button names

maiden tinsel
#

how to enable or disable Canvas via C# script?

mortal robin
mortal robin
maiden tinsel
#

nice

mortal robin
#

you'd write false to disable it ofc

maiden tinsel
#

i forgot to use GetComponent<>() before

#

thx for help

mortal robin
#

You don't really need GetComponent - you can directly reference it in the inspector too

#
public Canvas myCanvas;```
maiden tinsel
#

ok thanks

trail oar
#

As I wrote above. In a VR app I have a pop-up UI menu with buttons and a couple of check boxes. The right-hand primary button enables and disables the menu. When visible I can of course click the buttons and check a box but... (this is funny) when I toggle the UI menu closed and then open again the last element is clicked again. I've discovered something. It appears to be connected to enabling and disabling the UI panel. Doing that causes the events to fire as far as I can see and that causes the focused item to "fire".

#

I set the UI events with "obj".onValueChanged.AddListener() if that has anything to do with it.

sand mantle
#

Hey so I have a VerticalLayoutGroup of messages (with a title and a body). How can I make it so the body of the messages scales the message background size vertically (possibly using a Content Size Fitter) if the text is a TextMeshProUI and starting from scratch? I've tried multiple combinations without luck, thanks!

maiden tinsel
#

why is it such a bad quality?

#

in editor it looks normal

queen yarrow
#

Why is this so pixelated?

#

UI Slider

ionic beacon
#

Is that a zoomed-in play mode?

queen yarrow
#

Yeah, but got it fixed by enabling "Generate Mip Maps"

obsidian dust
#

How to I make my UI more zoomed in

#

its huge, but when I play it its really small

sterile wedge
obsidian dust
#

I got it all fixed, but thanks tho

frigid zephyr
#

i want these buttons to stretch to fit the bottom to the top

#

this is the parent

#

a button looks like this

#

when i scale the screen smaller however, the spacing and scale does not adjust to fit the new screen height

dapper scarab
#

buttons hitbox (?) dont corespond with their size and position

maiden tinsel
#

i have a problem with ui, in editor it's clear but in game it's kinda pixelated and ragged

maiden tinsel
hard nimbus
#

can you send the camera settings?

#

also you're zooming in, could be an issue as well

#

you have the scale set to 1.3x

maiden tinsel
#

ok, i am on my laptop now. i will send you these settings

maiden tinsel
maiden tinsel
#

wtf how i could be this dumb bruuh 💀💀🗿👌🗿🗿

#

thx for help man

low pike
toxic pasture
#

idk what was that called

toxic pasture
#

hello?

ocean sedge
azure flame
#

@ocean sedge Check that your button is clickable at all.

ocean sedge
#

im having problems with my button not doing anything when clicked

ocean sedge
azure flame
#

does it work at runtime. Shows change state on mouse over

ocean sedge
#
m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName```
#

thats the button its linked to

#

uiOpener.Clicky

#

the function in the screenshot above

#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

public class uiOpener : MonoBehaviour
{
    public static bool uiBool;
    public UnityEvent OpenUIButton;
    public GameObject uiObject;

    private void Awake()
    {
        uiObject.SetActive(false);
        Debug.Log("awake");
    }

    public void OnClicky()
    {
        Debug.Log("click");
        uiObject.SetActive(true);
        OpenUIButton.Invoke();
    }
}
#

this one

azure flame
#

I mean can you see the button work on the screen.

#

Button has tint color that can change on click or mouse over, Does it work at all

ocean sedge
#

you mean like its tint

#

nah no tint

azure flame
#

Is your EventSystem active? Select it and look at it

ocean sedge
#

this is what i see when i click on it when not running the game

azure flame
#

Then you have some other UI element covering the button. Text rects and invisible images would block raycasting.

low pike
#

OnClicky?

#

What's with the 'y'?

#

Has it been assigned to the UnityEvent in the inspector?

azure flame
#

For starters turn everything off except the button and test if it works. Then find what covers it

#

Yes, they didn't move their entire question. Event is assigned, seemingly to a correct object.

ocean sedge
#

i checked the ones i thought

#

and nothing happened

azure flame
#

EventSystem at runtime also shows debug screen in the inspector. Extend it from the bottom if it's not. You can see what object mouse is over and read what blocks raycast.

azure flame
#

Also just place a simple button on a new scene and make it work. Note all the parts making it work and compare.

ocean sedge
#

dimed

#

nevermind

#

its just not registering

ocean sedge
#

with the same script

low pike
# ocean sedge

Has this canvas got a Graphics Raycaster component on it?

ocean sedge
#

not from what i can see

low pike
#

so add one

ocean sedge
#

that works

#

thank you so much

#

and thanks fogsight for helping too

low pike
#

Did you not create that canvas from right mouse click?

ocean sedge
#

nah

low pike
#

that's your problem 😉

ocean sedge
#

xd

#

thanks

frigid zephyr
#

also when i scale the screen to be wider, the buttons expand past the window borders

low pike
#

0 spacing

meager quartz
#

whats the word when text entries are displayed like this

t
te
tex
text

where each letter loads in quickly 1 after another

#

i want to look up for a tutorial on how to do this but i dont even know what its called 💀

grave lily
#

you can do this using coroutines, where on every x miliseconds you update the text label

meager quartz
#

thanks

azure flame
#

@grave lily Please read server rules about giving ChatGPT answers. If you want to get an answer actually research the topic yourself.

azure flame
grave lily
fading creek
#

where can i find the image for this sprite? it says Resources/unity_builtin_extra but i can't find it anywhere in the projects files

cyan musk
#

Hey, Im trying to select a piece of text through code, but nothing seems to be happening other than the text just flashing for a moment.
working with TMP_InputField

#

I tried googling but nothing worked yet

worn kayak
dense crystal
#

looks like TMPro is no longer working with Rect Mask 2d's softness property.

#

just wondering if anyone has a solution

lyric edge
#

Hi, I am using custom cursor in my it works but the cursor is really big in my game, I am using a Cursor pack from assetstore with comes with 64x64 and 256x256 textures

#

What is the solutions to decrease the cursor size

#

At run time

grand moth
#

hey! i am trying to make a gameover screen panel, but can anyone please help me as to why my gameplay (pink) screen has shrunk? and the canvas size is massive?

mortal robin
#

Double click the canvas in the hierarchy window

#

Think of the big rectangle as your screen

#

UI elements in the middle of the rectangle will be in the middle of the screen

grand moth
#

it looks like this in the scene view

#

and this in the game view

grand moth
grand moth
mortal robin
mortal robin
grand moth
mortal robin
grand moth
ocean sedge
#

my game looks fine using unity simulator for phones, how do I make it automatically scale depending on device, as you can see my game is cropped on my phone

sterile wedge
ocean sedge
#

if anyone needs to know change the canvas scaler to change resolution

fringe jay
#

for a simple HP Bar, any suggestions on how to set the anchors of the retransform for a slider?

low pike
#

for a simple HP bar, don't use a slider

#

For any HP bar, don't use a slider

fringe jay
sterile wedge
worn minnow
#

New UI

fringe jay
sterile wedge
# fringe jay I don't see it

There's not much to the Image component.. please poke around. I think it's called Type. Might be Simple by default

fringe jay
#

Oh I’ve already figured it out and made 2 Health bars

cyan heron
#

what can I do to fix this for text mesh pro?

cyan heron
#

got it to work on a different font

cyan heron
#

why does my font look normal in the scene view but not in game view?

pliant saddle
#

Can you guys tell how improve visibility of ui element. I have sky background and ui lines are light blue. And the health bar is partially transpaent in the middle. The fill part is green. I'm adding reference image. But i our project we use it at sky background to make UI less distracting. Maybe to change size of element maybe to change something else target platform android VR. We use URP in our project.

cyan heron
lusty plaza
cyan heron
#

@lusty plaza the problem was the game view being set to an aspect ratio instead of a fixed resolution

lusty plaza
#

Yeah, in aspect ratio it's probably rendering at a lower resolution, which makes the pixels in the font bigger than the pixels on the screen

cyan heron
#

thx tho

dreamy warren
#

why do i not see my sprites in game view

mortal robin
#

Where did you put them?

#

What components are they using for rendering?

dreamy warren
dreamy warren
mortal robin
#

You're not using the correct components if so

#

You should have using Image, not SpriteRenderer

dreamy warren
#

yes it is

dreamy warren
dreamy warren
#

that did it

fresh saddle
#

Does anyone have a simple guide or anything that can tell me how to create a Listview within UI builder? Everything I see uses gameObjects, but my whole UI is built within UI Builder. I

#

I should also mention its a runtime UI

fresh saddle
#

my b

frigid vale
#

How could I pull out something like this? I want the character on my TB RPG to be folded paper, but how can I put UI that changes on the texture?

#

it this the right channel for this question? I am new to this server.

mortal robin
#

use that render texture in a material on your folding paper

#

<@&502884371011731486> ^

frigid vale
#

thanks

north magnet
#

All of a sudden my font asset became corrupted or something, and the Japanese kana table was reduced to like half of the characters, and some Chinese characters don't render. I haven't changed any settings, but who knows. What may cause things like this to happen to font assets?

#

I found some warnings relating to this in my console

#

I also imported the same font asset from a different project where it seemed to work well. It had more characters this time, but I also notice that the characters missing this time are the same as last time

#

it seemed to have gone well up until the まみむめ row, so is my Unity having problems importing?

#

I used the same font file on GIMP, it completes the whole table

crystal cloak
#

I have map that is randomly generated. It instantiates node points which are prefab gameobjects at random positions and connects them with lines.

How do I get these map nodes to be navigable via keyboard/controller?

mortal robin
crystal cloak
mortal robin
#

I thought you were not talking about UI

rapid ferry
#

Hi! I'm looking for a quick tutorial on UI that tries to stay on a world point but stays on screen if the point in the point goes outside the camera

north magnet
#

If this is the right place to ask about Font Assets, I was wondering if there was a way to "add on" to a font asset (I forgot to include the ASCII set in my hex list) without recreating the whole thing. Mine took like an hour to create because it had like 8000 characters to deal with. Thank you very much for your time.

wild pebble
humble patrol
#

simplistic ui test

low pike
viral trout
#

How do I set a max width for an UI element? Thats not 300px

north magnet
#

Thank you, I'll look up more on fallback fonts

#

How do they work? I couldn't find a documentation on them, just a few forum threads on specific issues people had

low pike
#

the TMP docs have a page about them

north magnet
#

oh right

frigid oracle
#

I have been struggling to get this to work for hours now. I have a <font="OpenDyslexic">word</font> tag and whatever I do, TMPro seems to be unable to recognize it. I tried putting it in my own Resources folder under "Fonts" and changed the settings for "path" in TMPro to "Fonts". No luck. I tried putting it in "Fonts & Materials", in the TMPro Resources folder and changed the settings back to their defaults. No luck there either. The spelling is correct, the file is named OpenDyslexic.asset but TMPro seems to be unable to recognize it no matter what I do. 😦 NEVER MIND. I switched it to the root and that worked. Switched it back the way it was and now that works. No clue why it wasn't working before.

winged wren
#

Hello, I have a question about how should Unity's UI tools be used in my situation:
I have a rectangle, where on the left side will be an image (it has to be 1:1 aspect ratio) and on the right side will be 3 text components (look at attached image). I want to make this rectangle responsive. What do I mean by that is: when I resize the rectangle, I want image to stay 1:1 aspect ratio, I want it to be the same height as the rectangle, I want the text in the right side to start where image ended.
I tried putting horizontal layout group on the parent of image and text parent (all text components are in one parent) and I put aspect ratio component on the image, but it shows warning, because it shouldn't be done this way. So how should it be done?

The warning text:
Parent has a type of layout group component. A child of a layout group should not have a Aspect Ratio Fitter component, since it should be driven by the layout group.

maiden tinsel
#

how to make it less pixelated so it wont look like it was made in ohio?

low pike
#

Use TMP , not Text

maiden tinsel
#

I want to make an option that lets you disable or enable antialiasing

#

So I need to make a check mark option

low pike
#

I'm sure you can work out how to Delete the text component and add the TMP component

maiden tinsel
#

Ok

gleaming dagger
#

Hey fellas I have a question that probably has a very simple answer I'm just not too familiar with UI tools. So I have a background sprite in my canvas for both my Date and Hour texts. Right now their edges are quite sharp and I want them to look more fading-out ish on the edges. How could I do that?

gleaming dagger
wild pebble
maiden tinsel
wild pebble
maiden tinsel
#

i want to make a dropdown menu using tmpro but when i change label text and play it, the text resets

#

i need to watch a tutorial on youtube

thorn zinc
#

Should player Deck and Opponent Deck be the other way around?

#

(because in the duel the player is on the bottom.)

thorn zinc
#

it was more of aesthetic question. Is that not a ux question? "Where on the screen should that ui element be?"

mortal robin
#

Yeah I suppose it fits

#

And yeah I think you should be consistent

ebon monolith
#

is it possible to get a game object components via button click?

mortal robin
#

to do what with

ebon monolith
ebon monolith
mortal robin
#

Isn't the object being clicked on the button?

#

You either assign the Image in the inspector, or use GetComponent<Image> on the button object

#

presumably if it's a prefab - you'd only have to do the inspector assignment once. Or, again, use GetComponent

ebon monolith
#

its not a prefab

mortal robin
#

probably should be, TBH

#

otherwise you're going to have to configure every one of these buttons manually

ebon monolith
mortal robin
#

inside the function

#

naturally

thorn zinc
#

sounds like the pseudocode you want is
assignSprite(gameObject g){
selectedGameObject.getComponent<Image>.sprite = g.getComponent<Image>.sprite;
}
putting that in some sort of image-assigning controller. presumably the object are selecting is already stored somewhere?

ebon monolith
#

or i did it wrong idk

mortal robin
mortal robin
#

example of?

#

How to use parameters in C#?

ebon monolith
#

im not really that experienced with coding

mortal robin
thorn zinc
#

ok so if you have a gameobject that has a controller script in it, you can drag it from the hierarchy to the on click event in the inspector.

mortal robin
#

if your function takes a parameter

ebon monolith
mortal robin
#

Unity scripting uses C#

ebon monolith
#

still quite diffrent

mortal robin
#

Nope

#

it's normal C#

#

You won't get that far without knowing C# basics

ebon monolith
#

thanks

ebon monolith
#

@mortal robin i tried this but didn't work yet no errors , what did i do wrong?

sterile wedge
ebon monolith
#

that is attached to a gamebject with an image

sterile wedge
#

Show how you have the button set up to call this?

#

And honestly if you don't understand parameters and want to wave it off, you will not get far as Praetor said

#

Start with some c# basics first

ebon monolith
sterile wedge
#

This isn't a video

ebon monolith
#

o

sterile wedge
toxic pasture
#

guys why i cant click button in Screen Space - Camera canvas?

vast flint
#

so guys I have a list of buttons and I want to add an sprite to the highlighted button amongst them
I 9-sliced the sprite so that the borders don't get stretched and only the blank part does but that's not happening
those are the settings of the sprite and button

vast flint
errant egret
#

Hello 👋

I have game objects laid out in a Grid Layout Group

I'm facing two challenges now:

  1. I have a code to enlarge on hover. The thing is, I wanted it to stay on top of everything else in the grid when it enlarges. Changing the Z value is not having any effect. Is the Grid overriding it? What can I do?

  2. How can I make the grid overlap elements more if the list continues to grow?

Help much appreciated, thank you!

meager quartz
#

From what i understand ui elements ignore Z value, i think you have to use scale instead

modest wing
#

The UI gets in a weird angle when i look up or down, My render mode is camera so that it has post processing applied to it

runic dock
#

so i have this prefab here. which is a popup text box. The popup object is a panel with a vertical layout group and a content size fitter, and the container object has another vertical layout group so that whatever text is displayed on the info object it will always fit the text. But this UI is not scaling to the screen size. is there any easy way to do that without writing code or should i write a script that reads the sceen size and scale the entire object acordingly?

cosmic herald
#

did unity have support for stuff like 3 tabs which you can navigate between and when you selected one it will allow you to navigate in the tab's menu itself so basically you are restricted to a few UI elements until pressing confirm

#

like this so you navigate between the tabs first and when you press the confirm key it will lock and allow for you to look at the options in the tab menu

soft sail
cosmic herald
#

Yeah, mostly want to create a system so i can only have a few ui components active for navigation until something is selected

hot roost
#

With a worldspace canvas. When the UI is hidden; enable = false on the canvas component vs disabling the whole gameobject...is there a big performance difference?

maiden tinsel
#

is it a good technique of making a game menu? just disabling or enabling it whenever player pauses it/plays?

low pike
#

It's an ok way of doing it yeah

maiden tinsel
#

nice

maiden tinsel
#

i want to make an option that lets player turn vsync on or off, which ui element should i choose?

indigo dew
#

Why the border is not showing?

#

this the asset

#

but it's showing like this

shrewd topaz
#

Faced with a problem when creating AssetBundle for font to use localization - the resulting file comes in 400kb and does not work when using, does anyone know the solution?
(Original TMP file with sd16 is 30mb)

fringe jay
#

So I have 2 Player hud blueprints for during the labrynth, which would you say looks better?

fresh coral
#

im trying to make the mask transparent

#

i was using the yellow circle to get the shape but i want the cricle to be transparent and the image under it to still be visable

#

any1 know how i can fix this?

mortal robin
#

Can't you uncheck "show mask graphic"?

restive patrol
#

Hi! Is it possible to use GridLayoutGroup only on demand? What I want is just place child elements like grid cells but not like GridLayoutGroup do it by default with set dirty and calculate only on next frame

wraith copper
#

why is my textmeshpro text on button blurry

low pike
#

provide details/ screenshots

maiden tinsel
#

i feel like my toggle is kinda buggy, when i'm pressing it with a controller it sometimes doesn't press at all or when i want to toggle it on it toggles on and toggles off after a 0.1second

maiden tinsel
wide torrent
#

Is there some way to only update a layoutgroup on start, and now every frame?

nimble sequoia
#

I have Ui which is anchored to the corner, but when I go into maximised view, it goes out of view

#

how do i fix this?

mortal robin
#

Are you sure your game view window isn't just zoomed in or something?

nimble sequoia
#

just

#

found that it might be due to my animation

#

but either way, im not zoomed in

#

yep, the animation was anchoring it on the x- coord

low pike
#

Press T and work with the UI gizmos

nimble sequoia
#

I've fixed it all! Just had to re-do the animations on the new animation anchors

#

irritating though!

honest belfry
#

Is there a way to make a ScreenSpace - camera canvas act like a WorldSpace canvas? Essentially, i need the canvas to be the exact same dimensions as the screen and resize dynamically with the window, but I want it to be placed in the world so that the player can naturally encounter it in the game environment. Is there a trick perhaps using multiple cameras or something to achieve this functionality?

mortal robin
honest belfry
low pike
fossil talon
#

I have a empty gameobject with only a content size fitter (content) and an empty gameobject with only a layout element (Node) with preferred size & width set. When i set content size fitter to preferred size on vertical, height gets set to 0. According to my googling, content size fitter should fit to the children. Whats am i doing wrong?

low pike
#

if Node is an empty game obejct, there is no content on it to size from

fossil talon
nimble sequoia
#

What does it do?

celest lodge
#

I have an issue where when i drop an object into a object thats in a gridlayout group, it doesnt go to the right place? how can i fix this?

boreal grotto
#

sry for the way in which I sent the message

#

This is the canvas in my hierarchy

low pike
#

You haven't shown enough info. Show the inspector for ScoreMenu and HighScoreMenu

boreal grotto
boreal grotto
#

HighScoreMenu is exactly the same

low pike
#

1- Never scale UI by the transform scale, always use width/ height
2- Why does it have a mesh renderer? I think you’ve used the wrong TMP

velvet seal
#

Can we mask UI without being a child in the hierarchy? For example under the same parent, the transforms beneath will be masked by an object above them.

soft sail
pulsar heart
#

Hello I have a scroll view with a child that has a vertical layout group and a content size fitter, the scroll function works, but the content is visible outside of the scroll area. ive been struggling with this for a long time and don't know what I'm doing wrong, probably the most frustrating easy seeming issue that's persisted

velvet seal
soft sail
# pulsar heart Hello I have a scroll view with a child that has a vertical layout group and a c...

If you've ever needed a scrollable container of items in your Unity game menus, keep watching! Confine any number of items to the limits of a container and mask the overflow.
Learn about the different settings of the scroll view/rect as well as how to use the 'Content Size Fitter' to dynamically resize your content.

❤️ Become a Tarobro on Patr...

▶ Play video
low pike
cyan sentinel
#

@errant egret this is the better place to ask for UI layouting.

errant egret
#

Thx @cyan sentinel , reposting here:

Howdy folks

I'm having issues with Canvas > Scale With Screen Size

Simply put.. the UI layout looks different on each resolution. It's not scaling as I had expected 😓

Do you know any good tutorials/guides about it? What could be my mistake?

cyan sentinel
#

Can you show your inspector?

#

Of your canvas

errant egret
#

I wonder if it's because I have the Pos X / Pos Y manually set for a few of my UI elements? IMO the scaler should scale that as well 🤔

cyan sentinel
#

Well, if you do not set it relative to parent objects but absolute, the scaler will not know what you expect it to scale it in responsive terms

#

can you show like two screens of what you get and what looks wrong?

errant egret
#

Does that mean I need to position everything through scripting?

#

That's any resolution with 16:9 (very simple example)

#

16:10 looks like this

cyan sentinel
#

Can you put your screen match mode to either width or hight?

#

like 0 or 1 instead of 0.5

errant egret
cyan sentinel
#

Yeah, you set your stuff to absolute values, so it tried to either fit your width or height of relative points. You gotta learn how to do responsive UI, so it can scale to any size you want. Did you checkout the unity learn tutorials about UI?

errant egret
cyan sentinel
#

No no, no scripting at all

#

You just make them fit the parent and set your anchor min and max to work as you expect

jovial shore
#

Hi, Im starting to use the UI and canvas in a serious project, so i need to know how to properly do things in the UI now,
My first question being how can I get my images to scale with the Canvas itself, and if there is a way to quickly see a preview of the in-game without having to Play it

north magnet
#

Hello, I have an issue regarding TextMeshPro and Unicode displaying. This is the right channel for tmp, right? Basically, TMPro.TextMeshPro.text is modified through a script, but the unicode characters don't update. They still managed to update when tinkering through editor.

cyan sentinel
errant egret
#

Sorry @cyan sentinel but that tutorial is not making any sense to me lol

I don't even have the 4 triangles anchor showing

cyan sentinel
jovial shore
#

Might be easier if I describe what im doing
Im making a quick info bar for my player with Health Ammo etc, for that I want a transparent black background and I am having trouble with setting the actual size,
This is how I would like it to look in the end, my canvas and images scale with the window size, I wanted to know how can I play with the size of that respective rectangle without having too much trouble.

cyan sentinel
jovial shore
#

left down is a blackish rectangle

#

Im just starting on that

#

I just wanted to know how can I do that easier

#

without having to do this

#

basically playing around the scale until something looked decent

#

ahem

#

forget all that talk I just realized I can just hide my game view screen and the canvas wouldnt get squished in a bad way

cyan sentinel
jovial shore
cyan sentinel
north magnet
#

Couldn't find the function, does anyone have any knowledge on TextMeshPro and Unicode usage through script?

cyan sentinel
north magnet
#

sure, something like this:

cyan sentinel
#

And what do you get?

cyan sentinel
north magnet
#

no, the unicode string builds correctly, and as the video shows the text gets set to that unicode string, but the unicode shows as its literal self and not the converted unicode characters

jovial shore
#

Anyone knows a platform where I can make my own simple sprites for the game?

#

Also, I imported a quick and dirty sprite made in paint but I can't color it, it stays the same color from paint.

north magnet
#

sprites as in 2D?

cyan sentinel
#

You are sure you included those numbers in your font of TMPro?

ionic beacon
#

@"\uff0e" etc means that the strings should be treated literally, the @ character specifically tells it "don't treat these as Unicode sequences"

#

and you can't build Unicode escape sequences from parts

cyan sentinel
#

totally missed that @ part 😄

#

You might wanna use a lookup table / array / Dictionary to return your unicode characters instead of that number array string combine which is not gonna work

north magnet
#

ohh

#

so do i do "\\uff05"?

#

"\uff05" doesn't work, seems like \u isn't an escape sequence

ionic beacon
#

"Doesn't work" in what way?

north magnet
#

well, "\uff05" raises an error

ionic beacon
#

what error

north magnet
#

sorry i was opening my laptop discord

ionic beacon
#

line 5834 😬

north magnet
#

lmao

ionic beacon
#

are you sure it's that line?

north magnet
#

yeah

ionic beacon
#

so no

#

Like I said, you can't build escape sequences from parts. They're compile-time constants

north magnet
#

what are parts in this context?

cyan sentinel
#

you cant create a new string that gets handled as a character

ionic beacon
#

It has to be a constant, like "\uff05". You can't do "\uff0" + "5"

north magnet
#

ohh

#

so this would become the ideal solution?

ionic beacon
#

I'd use the term "easiest" instead of "ideal"

cyan sentinel
#

you could still use a dictionary or simple list with your custom class that holds the case as number and the character related to it and just query your list

north magnet
#

oh right arrays exist lol

#

i use those sorts of solutions just slipped my mind

cyan sentinel
#

Hardcoded values are bad practice most of the time if you can avoid it and a list of characters that could extend later is one case 🙂

pulsar heart
#

but i have one more question: how come the scroll bar is beginning from the bottom instead of the top

#

when i run it it starts there

cyan sentinel
#

you have to set your textfield anchors to the correct ones so they anchor at top or bottom as you like

pulsar heart
#

like these anchors right?

cyan sentinel
pulsar heart
#

the text field as in the grid content field or the literal items inside the scroll area

cyan sentinel
# pulsar heart

It might be the pivot which needs to point on top too. Let me check real quick

pulsar heart
cyan sentinel
#

So this is my content holder

low pike
#

make sure this is set to 1 by default

cyan sentinel
#

And inside that, its just a textmeshpro field with lot of text

pulsar heart
#

like without even running it

cyan sentinel
#

Did you try the pivot like on my screenshot?

pulsar heart
#

apologies whats the pivot

cyan sentinel
#

check my screenshot 😉

pulsar heart
#

i did lol

cyan sentinel
#

below the anchors min max? 😉

pulsar heart
#

ahh my eyes don't work

#

lmao

#

sorry

cyan sentinel
#

😄

pulsar heart
#

my pivot on the GridContent is also already .5 and 1

pulsar heart
cyan sentinel
#

Wait, what is button choose, are those textfields?

pulsar heart
#

no

#

those are button prefabs

low pike
#

If the value of the sidebar is at 0, it's not a pivot issue

#

find what is setting the value to 0

pulsar heart
#

it cannot change from 0

cyan sentinel
#

Is your grid content setting its height correctly to fit the content?

pulsar heart
#

how would one embark on that journey

pulsar heart
pulsar heart
#

is there a method or guess and check lol

cyan sentinel
#

The Scrollview does that on its own if the content behaves like that.

low pike
#

look for references to it, what's your code doing

cyan sentinel
#

do you reference the scrollbar or scrollview at any point?

pulsar heart
#

i mean i reference it when i use it for the scroll rect

#

i dont think anything else

cyan sentinel
#

Yeah, thought so.

pulsar heart
#

and i also mean it's doing that without content

#

like on save

cyan sentinel
#

what is the height of your content container when you create those buttons?

shrewd topaz
#

Hi, I’m sorry to have repeated this, but I can’t solve this problem.

I am engaged in fan localization of the game similar to the Jackbox, and face the problem of TMP font, the original font - does not support the Polish language.

My created TMP font, after converted into Asset Bundle, does not work, any ideas?

pulsar heart
#

or before it knows about buttons lol

#

like before i run it the value changes after i set it

cyan sentinel
#

Yes, because there is no content so the max value it can reach is 0

pulsar heart
#

hm

#

but it allows me to set it to 1

#

just not save it

cyan sentinel
#

We should stop theorising 😉

#

For sake of testing. Create a default scrollview

#

Select the content gameobject, add a grid layout group and content size fitter to fit vertically, then add your prefab in edit mode until you reach the boundaries and see what the scrollbars do

pulsar heart
#

man whenever i ctrl z a prefab my unity crashes

cyan sentinel
#

Yeah sometimes Unity can make simple things hard

pulsar heart
#

it begins adding space to the top instead of the bottom

#

of the scrollbar

low pike
#

where do the new buttons get added

pulsar heart
#

inside code

#

but this time i manually added them

#

to check

#

like while it wasn't even running

low pike
#

I mean.. do they go below the previous ones or above

cyan sentinel
#

And your content rect transform is set as the one in my screenshot?

pulsar heart
#

They get added in the order of the array in the code

pulsar heart
#

But I think I’ve tested those before as well

#

Like the control child size

low pike
#

if you have it the second way, then the content is being added on top of the rest and the scrollview is growing upwards, not down

pulsar heart
#

I’d assume it’s right

low pike
#

Do not assume

pulsar heart
#

The joke is kinda assume I mean it shows it exactly

#

That it’s in chronological order

low pike
#

It's a drop down box on the layout element. Just check it.

pulsar heart
#

Again apologies for my lack of understanding

cyan sentinel
#

I still think its an issue with your anchors and pivots, but gotta go now, sorry.

pulsar heart
#

Thank you for trying yeah idk

#

Hopefully I can make it work lol

cyan sentinel
#

Just put oin the example scrollview everything to top pivot and anchor and use a default object isntead of your prefab for testing. Go from there

pulsar heart
#

i had to change the direction of the scroll bar to right to left even though its vertical im not going to ask but it works

wild cairn
#

Hey,
I'm using "UIHorizontal" button to change the Slider component value. Everytime I press the button, the normalized value gets changed by 0.1.
Is there a way to customize this changed value, to say, 0.05?

iron relic
#

is it possible for something to have a SortingOrder only within its context?
i.e. ive got a panel with sorted stuff and I put this panel on top of itself, i dont want the things from the behind panel to show through

mortal robin
iron relic
#

(im not using a Canvas btw)

mortal robin
acoustic oasis
#

Does anyone know if there's a built-in way to make the cell sizes flexible of a grid layout element? I have a list of images underneath each other but I don't like how there is so much space around the smaller item.

mortal robin
pulsar heart
#

is there a reason why this class wouldnt work? i.e. for the inactive it returns 191, 191, 191 somehow

acoustic oasis
#

I don't think this solved my problem. I can't seem to find a Flexible Padding setting in layoutElements, or flexible grid size

acoustic oasis
pulsar heart
#

i also tried that but its not true

#

like dividing them all by 255

#

they all become black

acoustic oasis
#

maybe add ,1 at the end?

#

for the transparancy

pulsar heart
#

a color is outputted

#

its 191, 191, 191

#

full transparency

acoustic oasis
#

These gave me pure 255,0,0 and 0,255,0

pulsar heart
#

that's why this is so odd to me

#

it outputs a color not there

pulsar heart
#

thank you

acoustic oasis
#

I imagine you didn't have the f's in there last time xD

#

but glad to be of help 🙂

pulsar heart
#

i did not lol

acoustic oasis
cosmic herald
#

Hello i am inheriting from the layoutgroup but was wondering if i can somehow hide the Child Alignment option?
I can't seem to override it/find it

fresh coral
#

Does any1 know how to chance textmeshprougui text color via code

#

ive watched some videos however im still unsure

#
public class CardDisplay : MonoBehaviour
{

    public Card card;

    public TextMeshProUGUI nameText;
    public TextMeshProUGUI descriptionText;
    public TextMeshProUGUI tier;

    public Image artworkImage;

    // Start is called before the first frame update
    void Start()
    {
        nameText.text = card.name;
        descriptionText.text = card.description;
        tier.text = card.tier;

        artworkImage.sprite = card.artwork;
        
        if(tier.name == "Rare"){
            tier.color = Color.cyan;
        }
    }

}
#

this is the code im using

#

runs with no errors but doesnt change color

#

nvm i fixed it its late and my brain lagged from code lol

restive patrol
#

Hi? When I scroll and disable UI element which was clicked at start of scrolling then scroll rect jumps up. How can I fix that?

cyan sentinel
wispy anchor
#

Hi
How is the intended hierarchy that needs to be setup if I want to create a bottom bar in UI that is always anchored to the left, the right and the bottom of the screen and it has a fixed height starting from the safe area (and not from the bottom of the screen)?
Do I need to script something custom to do this easy setup?

mortal robin
wispy anchor
#

Could you expand the topic? anchors, as far as I know, are always referring to the parent of the transform.
But here I need to have left, right and bottom anchored to the something that have screen dimensions and the top anchored to something that has safe are diemensions

lavish sluice
#

I am debating whether I should split up my UI into separate canvases or let it remain as is. I read that when a change is made on a UI element, everything on the canvas it is patented to will do some sort of refresh so splitting it up helps to make it more performant. However, i also read that when UI elements share a lot of things, they are batched to also help with performance. Most of my UI elements share the same background images and other stuff. Should I still go with the separating into canvases? Currently, there are no issues with my UI by the way.

celest lodge
#

is it because i put a button on the scroll rect or something

#

the event system isnt picking up any clicks

low pike
#

First thing to do, change the colours for the button states... so it is obvious when things are working

low pike
#

I wouldn't expect it to change, but when it is working you'll instantly see

#

Why would changing the colour fix it? 🤣

celest lodge
#

idk maybe i didnt see it change 😭

#

the map canvas is the top most one, idk why it isnt clicking

low pike
#

what's 'MapOverlay' ?

celest lodge
#

its an image

low pike
#

remove raycast image

celest lodge
errant egret
#

If I want to call a Cmd from a button click, it seems I can't set it as the On click event

        public void PassPriority() {
            CmdPassPriority();
        }

        [Command(requiresAuthority = false)]
        private void CmdPassPriority(NetworkConnectionToClient sender = null) {
            ...
        }

Is that really the way it goes? Using this dumb PassPriority function

obsidian geode
#

how do i make sure an image stretches to fit any resolution?

#

it doesn't cover everything especially in free aspect

errant brook
#

I'm trying to create a level selection screen, and I want the buttons to have a shadow. This shadow shows up perfectly fine in scene view, but doesn't at all in game view. Does anyone know why?

remote nexus
#

hey so i was making a quit scene in unity where when pressed a button ingame itll redirect to the main scene im using scene manager, ive put all scenes on build and the code is correct

my scene still doesnt seem to load even after ive pressed the button tho, ive even made proper buttons with it.. if anybody knows the reason why this might be happening pls do help me out..
thanks!!

main gale
#

make sure u have the correct scene index or name in the SceneManager.LoadScene() method

remote nexus
#

yeah

#

i do

main gale
#

can u show the build settings

remote nexus
main gale
#

does it have the correct function on the onClick event?

remote nexus
main gale
#

can u show the code of it

remote nexus
#

sure

main gale
#

just copy paste if its not too long

#

under 60 lines just copy paste

remote nexus
#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class QuitScene : MonoBehaviour
{ 

    public void changeScene()
    {
        SceneManager.LoadScene(0);
    }
}
#

i also tried with this

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class QuitScene : MonoBehaviour
{ 

    public void changeScene()
    {
        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 0);
    }
}
mortal robin
remote nexus
#

but in the event system it did

mortal robin
remote nexus
remote nexus
mortal robin
remote nexus
#

its enabled

#

i tried disbaling too

#

didnt work both ways

mortal robin
#

what's enabled?

remote nexus
#

the raycast target

mortal robin
#

I'm asking if you have a Graphic Raycaster component on your canvas

remote nexus
#

in the button

mortal robin
#

raycast target is important too, yes, but this is separate

mortal robin
#

Can you show screenshots of your hierarchy and the event system inspector etc

remote nexus
mortal robin
#

and also what happens when you mouse over your button while the game is running and the event system is selected? Does it show your button as the mouse over target?

remote nexus
#

no the only change in event system is that eligibleToClick become true

#

the selected is blank

remote nexus
#

oh yeah and my script is attached with the menu group

#

so uh these are the linked things

#

do you think something is wrong with where ive put the script or smthin?

mortal robin
#

No much more likely something is wrong in the scene setup

#

perhaps another object blocking the button for example

#

any errors in console?

remote nexus
mortal robin
#

stupid question but you are running the game right?

remote nexus
remote nexus
mortal robin
#

show your whole hierarchy

remote nexus
#

the game looks like tis

remote nexus
#

here

#

dont tell me this is supposed to be at top 💀

#

it still doesnt work so

#

only this become true if anything is clicked

#

rest is well no change

mortal robin
#

something is wrong then, it should show your button under pointerEnter

#

like this

remote nexus
#

nothing is shown in pointer enter

#

yeah something is wrong

#

are you familiar with the solution?

errant totem
#

bru why does it dissapear

#

bru it was too close to the camera in the z axis

#

Unity be like: "Yeah the elements are too close to the camera. 🤓 Don't ask why. 🤓 You have to adjust the z-axis of this 2d ui element. 🤓"

remote nexus
#

@mortal robin srry for the ping but do u think something could be up with this??

mortal robin
errant totem
#

yes but the way it works with 2d elements is still weird. Like the affect above where the ui would appear with a smaller window but not with a larger one.

desert jackal
#

I made a popup, but I'm still able to interact with other UI elements using the arrow keys. Is there a way to fix this?

grand moth
#

hey guys! does anyone know why the 'T' letter is showing up on my text even after i press play?

grand moth
desert jackal
#

When they’re enabled, symbols show up over things like sounds and text

grand moth
#

hey does anybody know how to get the pause screen as a seperate screen rather than as an overlay / panel? thank you

honest remnant
#

Hey, I'm SUPER new to Unity so be gentle heck_2. I want to render an animated character sprite in a Canvas. However, when I try adding a game object with a sprite renderer, animator, etc. OR an Image with the same things, nothing shows up. Is there something that I could be overlooking?

errant brook
#

I'm trying to create a level selection screen, and I want the buttons to have a shadow. This shadow shows up perfectly fine in scene view, but doesn't at all in game view. Does anyone know why?

mortal robin
mortal robin
sacred idol
#

Hey guys how do i remove this big icon of the text?

low pike
#

FYI - this channel isn't about editor UI

sacred idol
#

thanks, sorry about that

rocky holly
#

All of these clicks return the same position. I am trying to make my level editor inside of a scrollview, and I need to get the mouse position according to the view of the scrollview.

#

How can I do that properly?

remote nexus
#

is there any way i can move this canvas??

#

its locked for some reason

mild kernel
#

If it's a screen space canvas, then no. Change it to world space.

mortal robin
remote nexus
remote nexus
remote nexus
#

Ok then thanks

tranquil moss
#

Can someone help me? I added post processing to my game, but it doesn't work on my UI.

dense crystal
#

when building games for phones, how do you guys deal with the top bar area of the iphone 12 etc? like, the safe area literally changes

dense crystal
#

It seems only these later models of iphones/pixel devices with the smaller vertical safe area. The device simulator seems to display it properly, but do most people make their game dynamically recognize a notched safe area, or do you just build with the notch in mind for all devices?

meager quartz
#

the names like lake of abandon, deep wilderness etc (that you mouse over) have the text layer, 3
and the popups have layer 6

#

but it seems to just use the hierarchy on the left which i cant really modify. is there any other way to fix this

meager quartz
#

I guess second canvas can work if i unparent the objects but it will make the scene harder to organise

Weird that just the ui layer stuff just straight up doesnt work

mortal robin
#

What UI layer stuff

meager quartz
#

In the second image

#

I put the text in a lower layer than the popups but it had no effect

mortal robin
#

these are just layers

#

and their order doesn't mean anything for rendering

#

The main uses of layers, as described in this link^
physics interactions and culling masks for rendering.

meager quartz
#

Oh

soft sail
# low pike https://youtu.be/_wxitgdx-UI?t=1409

Between the documentations, videos, and the forums, I'm getting some mixed messages. Next time I work my mobile game I'll have to experiment with this a bit since as I could use some optimizations for the menus.

#

Ideally, I would like to make the majority of my in game inventory slots their own canvas, as at the moment I actually have to use a script to change the hierarchy on stuff I drag because of the layering issues.

cyan sentinel
soft sail
#

There's nothing necessarily wrong using a script to move ui elements throughout the hierarchy, I just remember scratching my head all day for the solution, thinking I was missing on some functionality of the canvas.

cyan sentinel
#

Nah, its just rendering my hierarchy on default. i use that all the time for example for UI that is anchored to a 3D world object but still scales and moves within 2d canvas, so it has the "effect" of being correctly depth calculated. Old project but been using those approaches a lot of times when multiple canvases were not an option

low pike
honest belfry
#

I have 2 images which share the same canvas (screen space camera), but each have different parents and one is tied to a layout group, yet i need to be able to overlap them visually on the screen but i am struggling to find the correct way to do so.. I am trying to use RectTransformUtility.ScreenPointToLocalPointInRectangle but im not sure if im using it incorrectly or if its the wrong functionality for this purpose entirely

rigid parcel
#

Hello
I do button for pause game
When I click it the timescale = 0 and menu show
But if I click the button behind the menu I can do that
How can I solve this?

outer oriole
cosmic herald
#

Hello, i want to change some elements when a button is currently selected like when you navigate the one that is currently highlighted.
I want to make some elements change color and become visible based on the active button. I don't think the button itself has a method for this to check if it's currently the selected one, where can i possibly find this?