#📲┃ui-ux

1 messages · Page 1 of 1 (latest)

robust lion
#

Whats a good software to make UI?

sage widget
#

How can I get rid of these distorted waves in the line?
It is just a simple canvas rendered in "Screen Space - Camera", with some white lines on it

frosty pewter
#

Antialiasing will help, but you may still face this issue as it's somewhat fundamental

#

The terms aliasing and moiré are both relevant

sage widget
#

ah yes I was looking for that term. Thanks! I'll look up some alternatives or maybe just switch to 3d lines

scenic stream
#

All of my sprites are significantly lower quality than the assets. How do I fix this

copper patio
#

@scenic stream right click the sprite / image in unity and goto properties. make sure the Max Size is bigger, set the quality up, etc.. those are where your settings are to make a pixelated crappy image look better. I've had this happen when i imported large images and they import janky and pixely (lower res)

#

thats also where you can generate Mip Maps if thats what someone suggested but I didn't need to for my UI images i brought in

scenic stream
#

hmm, i tried that earlier and it didnt seem to do anything

copper patio
scenic stream
copper patio
#

you can see the "Generate Mip Maps" checkbox but i havent ever messed with that, since im doing mostly 3D games and this is just for my UI canvas i used sprites

scenic stream
#

I'm not sure mipmaps is it. It just gets blurrier

scenic stream
copper patio
#

i mean i made my images 1920x1080 but 4k

#

so i was bringing in a 4k res image, and scaling to a 1920 canvas. so i am all at a 1:1 or 1:2 or 1:4 ratio

#

so i dont have anti-aliasing problems, per se...

#

but if i zoom down to some random size in the editor i can create jagged lines

#

but its not realistic for my game since its assumed its a UI overlay on the whole screen, there is no scaling down beyond just what is your monitor size = full screen

scenic stream
#

my source assets are pretty high quality for how small the sprites are

#

its so weird. Ive got the exact same ssettings

mortal robin
#

instead of bilinear

#

and turn off compression

scenic stream
#

compression helped, but bilinear is better than point filter

rapid ferry
#

Can I get some opinions on my UI prototype progress?

rapid ferry
#

Gotta do the left panel next which will be unit selection but I just finished the right

signal plover
#

when I design a main menu in Unity it looks great

#

but whenever I build and run it, it immediately looks awful

#

is there any way to have it scale appropriately so they don't become smaller the larger the aspect ratio you have?

mortal robin
#

and make sure your anchors/pivots etc are set up nicely

signal plover
#

aaah, "scale with screen"?

rapid ferry
#

Yes scale with screen size

limpid shale
#

how do i add toggles to a togglegroup?

#

figureditout

#

just needed to access the group property

limpid shale
#

if I have several toggle groups, what can i do to only have 2 toggles enabled max over the 8 groups?

brazen cradle
#

2d ui text using tmp, it shows up above sort layer 0 objects, but not above 1 and higher. what should i do

#

text is childed to canvas, and canvas using graphic raycaster

#

anybody?

timber wind
#

asked this question in #💻┃code-beginner and was referred to here. So i have this strange problem that both code and ui related. So im using the grid layout group for the grid in the players inv, and the player can move the items in the inv perfectly fine but when dragging the items it sometimes goes behind the the slots or other items. So i just used SetAsLastSibling(). But this causes a problem the grid layout group moves the slots when i do this. so i looked online for a way that wouldn't change the hierarchy, and found a solution where i would add a canvas component to all the slot object and change the sort order when the player would drag the item but that prevented the player from moving items in the inv and i cant seem to find another way to solve this problem.

vagrant kiln
#

Hey.
I've got a Textmesh Pro component with a content size fitter. My desired behaviour is that the textbox will expand horizontally - but only AFTER text wrapping fills the box vertically.

From everything I've tried, I seem locked into having it so that the content size fitter expands the textbox before the text wrapping kicks in.

timid forge
#

Is it somewhat possible to bring material design 3 into unity ?

worthy karma
#

grid snapping for rect not working when object is rotated

#

should I toggle it somewhere?

#

or unity is not capable of it...

modern frost
#

What is happening with my sprite? Top one is what it is suppose to look like, bottom one is what it looks like in Unity.

sterile wedge
modest rover
#

when i tried to scale the white panel

#

why does it belong to the grid with the blue dots as edges

#

and not on the white panel itself

charred rover
#

How do i make my button not look like that

fossil oasis
#

why is my camera view so small compared to everything else?

floral crow
#

becuase with overlay the screen resolution = 1 unit

#

switch canvas to camera space if you don't want that

charred rover
#

How do i make an image stay in the same spot even if the screen size would chnage ?

charred rover
#

Did not understand anything from what I've done but I managed to do it

#

So thanks

rapid ferry
charred rover
#

I figured it out.

safe fjord
#

is it possible to add a delay to an onclick event?

#

I’m attempting to switch between VR origin cameras temporarily by enabling/disabling one or the other. I’m doing this using UI OnClicks and so would like to add delay between switching. I’m rubbish with code and learning from the start at the moment! Would like a simple fix for the time being

low pike
#

There is no pre-built solution. You'll need to code it

mortal robin
unborn violet
#

I'm making a visual scripting editor for C#, and I want to let's say, get the name of a GameObject in Start()

#

this is how VRChat's UDON does it

#

by connecting the Start() event to the Debug.Log Node

#

however, for my editor

#

I don't just have event nodes

#

I have groups

#

and I need some way to define lines

#

do I just add a number to each one

#

and determine it based on height?

#

is that a good approach?

shadow fulcrum
#

Hi, I am making a game UI with Figma, and I would like to put it in unity soon. Since I am not an advanced graphic designer, I would love to get some feedback on this UI. Don't worry too much about the features, because I want feedback specifically for the UI and user experience
Any feedback would be helpful.

low pike
vale mason
#

Is it possible to route the interaction with one canvas to another canvas?

I'm working on a game where the player can shrink. When the player gets too small however, the text on all my menus turns to squares. To resolve this, I rendered the canvas with a second camera which follows the first, but does not scale. The canvas in turn, also does not scale. This however is messing with my raycasts because the canvas is in reality further away from the player than it appears to be thanks to the two camera setup.

So, I want to have two canvasses. One which always remains the same size and has all my UI elements on it with all their scripts that make them change as needed, and another which renders an invisible canvas that shrinks with the player and catches the raycasts and reports the locations of its hits to the elements attached to the first canvas.

Though as I was writing this out, I just thought of a potential solution. I'm not sure if it will work, but I might be able to parent the UI elements to the shrinking canvas, so they get its events, but attach them to parent object of their own which is itself parented to the canvas that does not change scale (or another object that doesn't change scale... I guess it doesn't have to be a second cnavas) via a parent constraint. However, my game is in VR and when I tried using parent constraints to render this second UI camera, it jittered like crazy, and I'm not sure why, so I'm concerned that's gonna happen here as well. I think the VR camera script is updating more often or later than the constraint is updated.

late maple
#

is there a hacky way to change all sprite renderers to Image?
Because I have several Sprite Renderer objects that I want to render on the canvas but apparently canvas doesnt render sprites, only images

mild kernel
rapid ferry
#

why are the buttons so big here and if i change to full screen it looks good

mild kernel
#

Because you're in free aspect mode and you didn't set up your UI using a proper aspect ratio, and probably didn't set your canvas to a decent reference resolution.

rapid ferry
#

oh

#

isn't free aspect the default option?

rapid ferry
mild kernel
#

On your canvas, set the reference resolution to 1080*1920 for example. Then set your game view to that.

Then position, and properly anchor your UI. Then switch between different game views to test.

rapid ferry
#

where is reference resolution?

mild kernel
#

UI Scale Mode, use scale with screen size

rapid ferry
#

ok

#

even worse now

#

i changed UI Scale mode back and changed and the game resolution to Full HD ( 1920 X 1080 ) but now there are gray lines on the edges

mild kernel
#

You need to use a reference resolution. 🤷‍♂️

#

You might manually make it look fine in one resolution, but it'll break in another aspect ratio if you don't have scaling and anchors set up.

rapid ferry
#

i see that people on youtube use free aspect

mild kernel
rapid ferry
#

ooh wait

mild kernel
#

Ok, you do you

rapid ferry
#

i had to change the reference resolution

low pike
rapid ferry
#

oh

#

also now the ui is really small

#

but its fine cuz in full screen it looks good

mild kernel
#

You're in free aspect again

rapid ferry
#

yea but what should i select

low pike
#

16:9

#

or Full HD

rapid ferry
mild kernel
#

You can add custom ones too. Such as the same resolution your reference is set to so you can position things exactly.

low pike
rapid ferry
#
  • gray bars on edges
low pike
#

the gray bars are not part of the game

mild kernel
#

Because you haven't set it up right. It's such beginner ignorance to think that "it's worse now" means it's wrong. It was never right to begin with, which is why you're asking for help here.

rapid ferry
#

oh

#

then how can i fix it

mild kernel
#
  1. Set a reference resolution
  2. Use that resolution on your game view
  3. Position, scale and anchor your UI
  4. Test different resolutions to see results
rapid ferry
#

so i have to use HD 1920 x 1080?

mild kernel
#

We're talking in circles, so I leave you with that list. Google tutorials if this confused youm

rapid ferry
#

k i'll use 1920 x 1080

hearty mulch
#

my image (ui image) shows in the editor but not the game, does anyone know why?

low pike
#

probably an anchoring issue

#

impossible to tell without any information

hearty mulch
#

what info do you want

reef cairn
#

Is there an alternative to a TextMeshPro that is a gameobject? So basically I want to count something, but its also part of the gameplay. It gets messy cause TextMeshPro refers to the Canvas for its location

mortal robin
#

TMP is a component on a GameObject

#

like all components in Unity

#

Are you asking if there's a world space version of TMP instead of a canvas/UI version?

#

The answer is yes. In fact it's literally the thing that's called TextMeshPro

#

the UI version is called TextMeshPro - UI

reef cairn
#

So does the world space version refer to its transform in the game scene?

#

And not the canvas?

low pike
#

doesn't use a canvas

reef cairn
#

Ohhh that’s where I messed up. I got the UI one. Thanks

reef cairn
#

I'm new to TextMeshPro. What do I drag around to change the size?

mortal robin
half thorn
#

i remember that i tihnk i had this issue before and it had something to do with a special character in the text files? 🤔

#

dont remember exactly

#

nvm found it!

low pike
#

So you'd do:
battleScreenData[3].text = $"You have fought {bm.opponent.alias} {bm.opponent.timesFought} times";

half thorn
#

thanks car!

flat crystal
#

It seems like that post processing turned that fake-black background into a solid black background that is not trnasparent

verbal holly
#

How can i make animation in the grid ?

haughty drift
#

Hi, I have a dialog system and i am using anchor position bottom stretch and i have a bool called dialog top, if that is selected i want to move the position to top. whats the best way to achieve this? i tried GetComponent<RectTransform>().anchoredPosition = new Vector2(969.5f, 859f); but it goes of canvas I'm guessing its because the default position is bottom?

low pike
#

the default position doesn't matter

#

it matters where it is anchored to

#

If the anchors are in the center still, then moving to 859 on Y will (probably) be too high

haughty drift
#

this is the defualt

#

this is the goal on bool selected

low pike
#

Shouldn't the new position be 0 on X?

haughty drift
#

yes thanks, So i set the y to 316f, and change the anchor to middle stretch, it looks ok in my game in play mode but could it look off position in other people monitors?

low pike
#

You'll need to test

#

add multiple resolutions to this

haughty drift
#

looks great in 19:6 and 1920 x 1080 but free aspect its not touching the top or bottom.

#

like so

low pike
#

don't ever use free aspect

#

Free aspect is just the size of the game view, it will never be a real world resolution or ratio. All it does is mess up your UI and waste your time.

haughty drift
#

ok, thanks. So is there away to make sure its allways at the very bottom rather then giving it a wierd number like 317f

low pike
#

anchor to the bottom, set Y to 0

haughty drift
#

ok thanks, last question that will work great for bottom but not for top, So can i reset this icon in code?

low pike
#

yep of course

#

can't remember how though, you'll need to look that up

haughty drift
#

whats it called so i can google it, is that the anchor position

#

maybe anchor presets?

#

thanks for your help

low pike
#

that sounds about right

haughty drift
#

thank you so much

rapid ferry
#

Just finished the visuals for my reset button

#

thoughts?

wicked patio
#

the s is maybe too close to the border though

#

actually not, it just looks like its too close because that moving effect is next to it, on the still image

sterile wedge
rapid ferry
#

Panning texture

violet sandal
low pike
#

and the lines that move around the edge, how did you do that?

rapid ferry
half thorn
#

how come the text is coming out like that in the scroll view?

#

i added a \n in the code and now it looks like this

#
opinionText.text = $"{currentHuman.alias}:\n{targetHuman.opinions[currentHuman.ID]}";
#

scrolling through, it looks like only 10ish percent of them are looking weird

vale mason
#

I have a menu with a button as a child, and when clicked the button calls a method on the menu to set a variable. But I'd also like to get a link back to that button so I can change its color. I think someone told me before that Unity would handle that automatically? Maybe by creating a single parameter that is a gameobject? Does this need to be formatted a specific way? And can anything besides a gameobject be passed automatically in this way? Like the button component itself?

#

Nevermind, I found the original place I asked about this. Apparently you do just make a GameObject field on the method being called and it will get passed to it: #archived-code-general message

[edit]

Well, shoot... I apparently can't easily pass TWO parameters with OnClick(). It only allows one. That sucks. I don't want to make a script just to hold the value of the button, then pass the gameobject instead, then get the script component to read the value... Ugh. And having two OnClick() events one after the other calling different methods, one to set the value and one to pass the gameobject is also not a very clean solution.

Hm... I suppose I could also have OnClick() call a method on the button itself with the value I want to pass to my menu, which would then have access to the Button's gameobject, which it could then pass along to the menu's method with the value. But that's also kinda messy, requiring a second script.

half thorn
distant fiber
#

Is there a good way to fit a chat log into a scrollable canvas? The content holder is not expanding when I add Text xD Help pls

low pike
#

put a content size fitter on it

distant fiber
copper meadow
#

i wanted to keep background inside the phone frame
so i made background a child of phone frame and added mask on phone frame object

#

result being... did i miss a step or something?

distant fiber
#

xD

copper meadow
#

;-;

#

nvm. solved it

#

made another gameobject and resize it manually so it doesnt go outside the inside frame and repeated the previous step

#

not the best solution but it works for now

worthy karma
#

what funny here is that when I manually update the text in editor the UI updates correctly and text does not overlay other verticalgroup elemenets. Do you know the event which I can trigger realtime to update my UI layouts?

#

here is how it should look btw (not overlayed)

#

what should I do?

violet sandal
worthy karma
#

yes exactly

#

and it does

#

but at 50% chance

#

during runtime

#

layout is not detecting that its element has grown in size

#

cringe

violet sandal
#

Do you have a content size fitter on the Parent (image) and the child (text) ?

worthy karma
#

yes I do

#

here is the skeleton

violet sandal
#

And a Vertical Layout Group on the Image?

worthy karma
#

yes, correct

#

I mean

#

I have watched how to make images stretch that have text inside and it works great

#

but it does work at 50% rate when you change the text through script

violet sandal
worthy karma
#

seems like yes

#

didn't know there are people who run into my problems too

mild kernel
#

@worthy karma No memes here

violet sandal
#

Mostly every problem was solved somewhere.. if not, its a unity bug 😄

#

or a feature.. lol 😄

worthy karma
worthy karma
#

@violet sandal perfection

#
LayoutRebuilder.ForceRebuildLayoutImmediate(itemInfoScrollView.GetComponent<RectTransform>());

this line of code fixed the whole item info panel, if you ever need it ☺️

violet sandal
#

👍🏻

#

You just need the right keywords when googling 😄

worthy karma
#

yeah 🚬

azure flame
#

I've had a case when one of the rebuild layout methods didn't work or work not every time, solution was, to reliably repaint UI after updating some element under Content Size Fitters had to run both LayoutRebuilder.ForceRebuildLayoutImmediate and LayoutRebuilder.MarkLayoutForRebuild on the root element, in that order.

sterile wedge
#

because i've also had a situation where sometimes it doesn't work to just do ForceRebuild, but i hadn't heard of MarkLayout until now

azure flame
#

I recall trying many thing and in different order, even putting many LayoutRebuilder.ForceRebuildLayoutImmediate at once... That was a combination that was the most reliable.

#

I think turning off entire hierarchy and skipping frame, turning on also works, but those method seems to be designed to have the least impact on performance.

sterile wedge
#

yeah I usually do the "turn off", wait for end of frame, "turn on" thing as a last resort

molten vale
#

hi, im trying to move a rect transform by 32pixels on X position in code, settings rect.position = Vector3(32,0,0); I am using Canvas scaler, and with Scale With Screen Size, whenever the resolution is smaller it multiplies my value, or larger it divides, is there a way to ignore Canvas Scaler when setting position?

low pike
#

rect.position = Vector3(32,0,0);

This will set the position TO 32 not move by 32

#

use .anchoredPosition to set the position

molten vale
#

thanks @low pike , it somehow didn't work before with anchoredPosition, guess I miss spelled something, works like a charm now

low pike
#

Your IDE (VS?) should be giving you autocomplete suggestions and errors .. if it isn't, #854851968446365696 -> IDE configuration

molten vale
#

Not that, I mean I used it incorrectly

quick wing
#

Does anyone know why the raycasting and stuff is messed up with the UI on a Render Texture attached to a Plane?

#

basically when I put my mouse in certain spots the button highlights and I can click it but when I go for the middle of the button and where the button is actually at it doesn't highlight and I can't click it

azure flame
#

Open event system debug area at runtime and see what's blocking it

azure flame
#

it's on the bottom of the evenet system inspector

quick wing
#

I changed the size around a bit but its doing the same thing

#

On some spots of the button It enters the "panel"

#

Some spots outside of the button it's the button

low pike
#

disable 'raycast target' on the text

rancid magnet
#

Any idea of what tool is able to re-create this 3d image or something similar?

novel stag
#

Anyone here?

#

I need help

azure flame
novel stag
azure flame
#

@novel stag Use appropriate channel next time

shadow fulcrum
#

Hi everyone, I have a question, I have a complete UI with figma, but now I would like to convert this quickly and easy into unity. Does anyoe know how to do this, because I wouldn't find it very effective to completely rebuild this UI in Unity. It should also be a free solution.

frigid cobalt
shadow fulcrum
frigid cobalt
#

Manually converting is the only ‘free’ way I know.

rapid ferry
#

im trying to convert the scrollbar into a scroll view so that i can click anywhere, the scrollbar's value changes as i slide my pointer/touch up and down. but Im unable to do it

#

however when i add a scroll view, it oddly morphs my scroll bar and changes the dimensions

rapid ferry
quick wing
shadow fulcrum
#

Hello everyone I have a question do u think this ui and game fit well together?

heady fable
#

how do i assign a Healthbar via scirpt?

violet sandal
heady fable
#

yea i know the problem i had was not explained in any of those tutorials but gladly i already received help but ty

brave magnet
#

I can't find the "text" in the UI create thingy

#

Help

green arch
#

Right click anywhere under your scene name (in the hierarchy tab) and click on UI from there. (Text and all the relatives should appear)

brave magnet
#

Yep that's what I did but I still can't see "Text"

#

Oops nvm

green arch
#

Also try TextMeshPro (from the Package Manager)
It's basically text but more User Friendly and extra features.

mortal robin
#

TMP is installed by default on new unity projects in recent versions

green arch
mortal robin
green arch
mortal robin
#

sort of like AnimationCurve, but for Color instead of numbers

mortal robin
#

poof you have a gradient

#

3d/2d is irrelevant

green arch
#

I feel like I'm doing this wrong

mortal robin
green arch
#

ohhh It's something I apply to an object that is using a Color.

green arch
warm ore
#

How come my 'Bank' canvas is not showing but the 'Withdraw' and Notification do? I've messed around with the Sort Order and it still wont display, it's like its gone invisible.

#

Ah, i had my scale set to 0

#

fixed

foggy heron
#

i'm making a map on a canvas by tiling together these images but i'm getting these seams

#

any clue how to resolve them?

brave magnet
#

Might be a problem with your image

#

Make sure there's nothing on the edges of the texture @foggy heron

foggy heron
#

there's nothing

#

it tiles well most of the time

#

just that when I move it around, it sometimes creates these lines

#

I make sure to only move them in whole pixels as well

brave magnet
#

Are you using a shader for the tiling?

foggy heron
#

nope

#

uh what i'm doing is manually placing these gameobjects with recttransforms in the correct place

#

each gameobject has an image component

foggy heron
brave magnet
#

Are you sure that the positions are right?

foggy heron
#

yup

brave magnet
#

Like there's no space

foggy heron
#

precisely in whole pixels, and the sizes of the rect transforms are precise as well

#

most of the time it looks fine

brave magnet
#

Hm that's weird, might be just a problem with the preview?

foggy heron
#

happens in play and build as well

#

for context this is a resizable map and it happens at certain scales

#

I do constrain the scales to certain numbers only but i'm still having the issue

inner dagger
#

Is there a way to set the UI Canvas to render to a specific resolution size independant of the game window resolution? Canvas Reference Resolution doesnt seem to effect the resolution at which it draws the UI, only the scaling of units for things such as position and scale.

I wish to draw the UI at a resolution of 640x360 while allowing the game window resolution to be at any resolution. The only way I have found to achieve this is with a full screen shader effect, which is making the pixel perfect UI I created have rendering issues as it scales incorrectly.

#

This shows the issue I am having, the top shows the desired effect, the bottom shows what the fullscreen shader effect is causing

inland gyro
#

This is probably obvious but I've been pounding my head into a wall for two hours while looking through google and trying stuff out so I might as well ask where someone may help.

I'm trying to get the position of the mouse and position of a UI image and calculate some stuff based on that. However nothing I do will get me the positions in the same layout. Mouse position for whatever reason is working in Q1 instead of Q4 (mouse pos has inverted y). Then the UI's position is for some reason also wrong compared to that. I got Mouse position to be correct just by taking it away from Screen.height but the UI position never aligns to it.

(Note that rect is the RectTransform of the ui object)
I've tried

Vector2 topleft = new Vector2(rect.anchoredPosition.x - rect.rect.xMin, rect.anchoredPosition.y - rect.rect.yMin);
Vector2 bottomright = new Vector2(rect.anchoredPosition.x + rect.rect.xMax, rect.anchoredPosition.y + rect.rect.yMax);

Originally I was using this from an old project that used new input and had ui calculations but it also doesn't work

Vector2 topleft = new Vector2(rect.transform.position.x - rect.rect.xMin, rect.transform.position.y - rect.rect.yMin);
Vector2 bottomright = new Vector2(rect.transform.position.x + rect.rect.xMax, rect.transform.position.y + rect.rect.yMax);

Even the seemingly seemingly proper

Vector2 topleft = new Vector2(rect.position.x, rect.position.y);
Vector2 bottomright = new Vector2(rect.position.x + rect.rect.width, rect.position.y + rect.rect.height);

doesn't work at all.

I'm using the new input system and the mouse position is correct based on the 1920x1080 resolution I have the UI on (i.e. the mouse position is between 0 and 1920 or 1080). The UI's canvas's render mode is set to Screen Space - Overlay and it's UI scale mode is Scale With Screen Size, and I'm using Unity 2021.1.22f1.

inland obsidian
#

How do I make this panel fit exactly into its child? (a text component). I currently have attached a Content Size Fitter with Preferred Size on the panel but it's not working as you can see

sterile wedge
inland obsidian
#

But now I have the problem that there is no Padding option in the Content Size Fitter, but my panel has got this border. How do I add a margin left and right?

hearty yacht
#

I switched the Render Mode of my Canvas to Screen Space - Camera so I could use Post-Process effects but now the Canvas resolution is affected by the Render Scale.

#

Is there a way to make it so that the UI is always rendered at native resolution?

sterile wedge
misty kernel
#

How would I use the horizontal layout group outside of a canvas or ui in general?

sterile wedge
#

Not sure you can. Never tried.

#

Might just be a UI thing

misty kernel
#

welp, guess I gotta make a custom script, was only planning to use it for debugging anyway as i wanted to make interfaces later, but guess I'll have to do it early now

sterile wedge
#

You could try and see if you can

misty kernel
#

i did, thats how i know it doesnt

#

which is why i thought there might be some hacky workaround or something

misty kernel
#

My textmeshpro (not ugui) overlaps other objects, how do I disable this?

outer depot
#

Hi guys. I noticed that if I lose focus by clicking the mouse outside the window and then I click a UI button in my scene, the event is not registered and I have to click a second time. Is it possible to solve the problem without using event triggers? Thank you.

next dust
#

I'm unsure if this is the wrong channel, I apologise if I'm incorrect but I need advice on how to start with something, I want to represent a shape using squares, like a country shape and be able to change the colour of each pixel individually and also change a random one, what would be the best way to do this in unity?

sinful arch
#

Hi there! Anybody knows, how to make splashscreen fullscreen for android devices? On some screen resolutions there are black indents and the picture is not stretched to full screen

mortal robin
#

there's tutorials on youtube for it probably. It's just modfiying a texture pixel by pixel basically

regal thorn
#

Hey yall, I'm trying to make a scrollable list on a tablet in unity, and as soon as I add a RectMask2d component to the parent of my content, all of the content disappears. Any suggestions?

frigid cobalt
barren mica
#

When I go into certain areas my ui text disappears

#

I need help with how to fix it

violet sandal
wraith sluice
#

hi guys, i have a question. I need a button how makes the UIDocument disapear and set the view on main cam. . the method is needed button and stuff around is already there.

ionic drum
#

Anyone ever had problems with Unity UI buttons not responding properly in low frame rate conditions?

#

Got an iOS AR app with very unsteady performance, and if I try to navigate the UI when the performance is bad, buttons will seemingly fail to register input, or perhaps register multiple inputs

#

The result is that the button I press becomes deselected, and then there is no way to press the button again afterwards

quaint hazel
#

How does one put a gradient over a whole section of text instead of on a per letter basis with TMPro

quaint hazel
mortal robin
#

So it is

quaint hazel
#

it goes red blue red blue red blue

#

i want a smooth red to blue over the whole textr

mortal robin
#

I get it

quaint hazel
#

I guess i'll make different texts for the different elements

#

sad

long plinth
#

How do I make this text centered?

#

or do I have to create a new sprite with play text?

#

these are two sprites attached to a button for pressed and highlighted state

quaint hazel
long plinth
#

no. I just want it to appear in the middle when pressed

quaint hazel
#

So be in one place when not pressed and another when pressed

#

aka moving

long plinth
#

yes

#

kind of

#

but should work in different screen sizes

quaint hazel
#

Well I think you need to either code this behavior, or the simpler/portable way is to just put your text directly on your button sprite

#

Maybe with some content fit you could also do it

long plinth
#

so I think the better way is to just create different sprites

#

I have another question. isn't it in efficient to create sprites for different ui elements e.g. play, quit and options

#

or it's ok?

#

also it will be a button group and I cannot place content fitter on the child

north smelt
#

my tread tho

sterile wedge
low pike
#

There's a reply with the answer in that thread

north smelt
low pike
#

If you need further help with it, reply to that thread and/or ask in #🧰┃ui-toolkit - that's the place for the new UI

north smelt
#

so it's actually fully UI related

north smelt
low pike
#

"fully UI" .. what does that even mean?

#

UIToolkit isn't a half UI

north smelt
low pike
#

It uses UIToolkit OR UGUI.

north smelt
#

k thanks

low pike
#

If you are using UGUI, then you just need to use a mask

#

which you can find info on in the docs

north smelt
plucky wedge
#

Hello, when i press the back button the second time it doesnt work

#

@low pike

low pike
#

What? Why are you randomly pinging me ? 😄

plucky wedge
low pike
#

Oh right. I did see your msg.. but as it has no information as to how you have implenented anything.. I didn't reply, because I'm working and don't have the time to be chasing info that should be given with a question. Sorry.

plucky wedge
#

Sorry sir

#

Fixed it now

wild matrix
#

[QUESTION]
Hey, can someone tell me how to deactivate the gizmos for reflection probes? (See image) I tried deactivating them in the gizmo menu, but unticking it has no impact?

worthy arrow
#

Guys, for Menu with options on top like this, It's just multiple scenes like normal?

low pike
#

No, you wouldn't have those in multiple scenes

low pike
#

It's a warning, not an error. And not related to UI. Delete from here and ask in #💻┃unity-talk

lean fog
#

hey how can i make the camera fit the grid ?

#

i can't figure it out

mortal robin
lean fog
mortal robin
#

and selecting an appropriate canvas scaler mode

lean fog
#

not the yu

#

ui

mortal robin
#

and decide if you want to fit the width or height of the tilemap (you can't do both)

lean fog
mortal robin
#

then your script is broken

lean fog
#

no shit sherlock

rich ether
rapid ferry
#

Close button UI finished I think

#

I wanted something a little more creative than just an "X" button

violet sandal
barren mica
#

help pls

rapid ferry
violet sandal
# barren mica ?

i have no clue. Its hard to tell without seeing all the settings there.

low pike
rapid ferry
# low pike Difficult to tell from this gif, but does the UX work with a crystal? An X is us...

With some more context: It's an incremental game and the crystal is the main thing you click. The individual units you upgrade have their own talent trees that are accessed by right clicking them. In order to close the panel you "return to the crystal" which I thought I'd represent with the crystal itself. Because you see the crystal so much, I figured that representing it as an icon of itself would work because of familiarity

#

I can have a pop up explaining/indicating for clarity (I have a tooltip already) but when I was talking to my friend UX was the one thing I wasn't sure about if it would be too obtuse

#

I'm playtesting an early version at the end of this month so I will have to see how people interact

rapid ferry
low pike
low pike
#

horizontal layoutgroup on their parent

livid bay
#

ty

near folio
#

I just noticed something; my project is in linear color space, and I have a GameObject with a sprite that is just a flood-filled png with color (8,8,8) (very dark grey). I have a canvas with an object that has an Image component with no source image. When I set the color value of that Image component to (8,8,8), I get a lighter shade of grey than the sprite has, specifically (13,13,13).

This leads me to believe that even if the player is set to linear color space, canvas elements are still in gamma. Is this a known issue, and if so, is there a fix?

Update: If I use a sprite in the Image component, instead of just the color setting, this problem seems to go away. So it seems to be an issue with the color setting in particular. This workaround is fine for me.

junior silo
#

Hey, how do you guys work with dark tilesets? Cause I don't find where to change the TilePalette Window's background color in Unity, and the solution I found doesn't work anymore since Unity's code has changed

For example, I don't think I'll go through the pain of working with a dark background and that tileset haha

elfin vale
#

Hi, I am having trouble trying to display some text on top of the what the camera displays on the screen, I am using a pixel perfect camera to display the camera. I don't want the text to interfere/block what is displayed by the camera

junior silo
fresh galleon
#

is anyone aware of anything that might be causing my rect transform to increase up to my player size when its created?

#

even though the prefab is a lot smaller

#

never mind if fixed it, in the script instead of setting the parent using a variable i set it directly in the instantiate

#

it must be fullscreen by default so when its instantiated without a parent briefly it gets too big

graceful ember
#

The png I imported don't look the same. Colors aren't matching. Any suggestions?

haughty drift
#

Hi needs some help please, im making a quest/misson ui panel where i can see current quests. So i have a list and i have a ui panel if i instantiate the panel, how can i get them to stack under one another?

mild kernel
#

Use a vertical layout group

haughty drift
#

Cheers

#
    {
        var list = QuestManagerPlayer.instance.questMarkerNames;

        for (int i = 0; i < list.Count; i++)
        {
            questMarkerNames.Add(list[i]);
        }

        for (int i = 0; i < questMarkerNames.Count; i++)
        {
            Instantiate(questPanel);
            
            quest.text = questMarkerNames[i];
        }
    }``` what am i doing wrong here? Im try to duplicate the quest panel on the ui on every item in the list, what im getting is only one panel and displaying the last quest in the list
low pike
#

are all the lists actually containing the things you think they are?

haughty drift
#

i think my instantiate is wrong

#

The list only populates when i click the button, Could it be that its too slow?

low pike
#

Nothing to do with speed. Sounds like you're only calling it on the button click

haughty drift
#

So if i do this on update instead do you think that could fix it, Does the code look ok to you?

low pike
#
public void ShowQuests()
{
  int nameCount = QuestManagerPlayer.instance.questMarkerNames.Count;

  for (int i = 0; i < nameCount; i++)
  {
    Instantiate(questPanel);
            
    quest.text = QuestManagerPlayer.instance.questMarkerNames[i];
  }
}```
low pike
#

oh, wait

#

of course!

#

quest.text = QuestManagerPlayer.instance.questMarkerNames[i]; this sets the text to the thing you give it.

#

quest.text += $"{QuestManagerPlayer.instance.questMarkerNames[i]}\n"; this will add to the text

haughty drift
#

Im trying to add a new panel on each quest, thats why i thought instanciate was the answer, If im reading your comment correctly it will put it into the same panel with a new line?

low pike
#

Right, but you're using the same quest label for each one

low pike
haughty drift
#

ah ok i see

#

questLable being the text element inside the panel, not the panel its self?

low pike
#

of course

#

The thing you set the text of

haughty drift
low pike
low pike
# haughty drift

You obviously can't just throw [] on something that isn't a list/array..

haughty drift
#

of course sorry, just copy and paste without thinking my bad

low pike
#

Have a read of that link I just shared

haughty drift
#

just reading now

haughty drift
#

ok so it does instantiates but out side of the ui

low pike
#

gotta give it a parent with the instantiate

haughty drift
#

Thanks that worked, But now every time i press that ui button it clones it?

#
    {
        int nameCount = QuestManagerPlayer.instance.questMarkerNames.Count;

        for (int i = 0; i < nameCount; i++)
        {
            Instantiate(questPanel, questPanel.transform.parent);
        }
    }``` this is what im down to
#

just learning the Instantiate, before i move onto the text part. questmakersname should only be one at this stage, but just adds one each time

elfin vale
low pike
haughty drift
#

Yes so i thought that i could maybe delete all quest panels on open and then it will only clone the amount inside the list, but of course if there is no list it will delete the original then ill get the error, cant find instance of object as its deleted

novel stag
#

Hello everyone ! I have some issue regarding my UI ... I'd like to make an overlay with a scroll view containing 3D objects. So far I have that as hierarchy. Basically I made a canvas with "screen space - camera" with a render camera, a basic scroll view with 3d spheres in the content. The "cube" you see is a mask I created with shaders to hide the cubes outside of the UI.

Now the issue is that I cannot find how to scale the cube with the UI (that scales with the window's size) ...

#

Here's the result so far

#

But when I reduce the window :

novel stag
#

Ok just got an idea to fix it after writing the question and it works ...

low pike
#

1- Don't use GetComponent<T>() in Update()
2- change the field - public GameObject viewport; to public RecTransform viewport; .. so you don't need the GetComponent<T>(). Re-assign the RectTransform in the inspector

haughty drift
# low pike So you now need to think about the logic behind when this is getting called
    {
        for (int i = 0; i < questPanelParent.transform.childCount; i++)
        {
            if(questPanelParent.transform.GetChild(i).name == "Quest Panel(Clone)"){
                Destroy(questPanelParent.transform.GetChild(i).gameObject);
            }
        }
        
        int nameCount = QuestManagerPlayer.instance.questMarkerNames.Count;

        for (int i = 0; i < nameCount; i++)
        {
            Instantiate(questPanel, questPanel.transform.parent);
        }
    }``` i did this it works, is it the correct way?
low pike
#

"correct" way.. is a way that works.
What's left is good/bad/optimised/efficient ways

haughty drift
#

ok thanks for your help today

low pike
void solstice
#

the EventSystem I guess

low pike
#

so, you just mean a slider

#

step size is 10% .. don't see a way to change/ set it

void solstice
#

oh wait, maybe its the drag threshold

#

mm nope... thats not it

void solstice
#

I can just change that 0.1f to 0.05f

low pike
#

3 dots -> edit script

#

on the component

#

no you won't be able to change it

void solstice
#

on the event system?

low pike
#

no, the slider

void solstice
#

ah...

low pike
#

neither of the components on the event system game object will have an effect on this for the slider

void solstice
#

well thats annoying... I might have to just do some hacky stuff then.... make it so everytime the value changes, see if it was < or > previous value, and set it to previous value +- whatever increment I want

low pike
#

Perhaps an extension of the class and override OnMove(AxisEventData eventData)

void solstice
#

its a bit beyond me on how to implement that honestly

#

I'm just going to do it within my menu script

junior silo
#

Anyone knows the shortcut that allows me to go to next or previous object in my scene? Would be very handful to draw several layers quickly!

haughty drift
#

What does it mean when the text as disappeared and you get a red x instead i seen this a few years ago but i can't remember the fix

frigid cobalt
haughty drift
#

thanks

elfin vale
#

Can someone please tell me how to display some text on top of the what the camera displays on the screen, I am using a pixel perfect camera to display the camera. I don't want the text to interfere/block what is displayed by the camera

frigid cobalt
elfin vale
frigid cobalt
#

It might be possible with a render texture, but it will just cause more more issues than are necessary.

elfin vale
#

Ok

feral drift
#

im making a start menu for my game. im making the options menu currently, and i just want the main menu to disappear but it wont. even clicking on the eye symbol wont work. nothing disappears. It disappears in the editor, but when in play mode it wont disappear. im using tmp for my text and the button is a component of my tmp text.

frigid cobalt
worn hull
#

has anyone ad any issues with TMP dropdowns specifically with it not being able to find the toggle in the template?

#

GetComponentInChildren<Toggle>() is returning null for some reason even though the toggle is clearly there

#

Having one dropdown with the template name unchanged works fine, but as soon as I change its name, it is unable to properly fetch the Toggle component from the its child "Item"

mortal robin
#

There's a second parameter for GetComponentInChildren to find deactivated components

#

Iirc

feral drift
wise elk
#

I'm getting some pretty bad banding, is this the simulator or actually color compression on unity side? Top is unity bottom is windows

exotic coyote
#

Hey! What's the best way to make particles appear on top of the UI images? I only found 2nd camera workarounds in google... Thanks!

mortal robin
haughty drift
#

Hi i need some help please, im creating a misson/quest list so the list comes from my game manager, Then what i want is when i press the quest button it displays the list of quests.

#
    {
        for (int i = 0; i < questPanelParent.transform.childCount; i++)
        {
            if(questPanelParent.transform.GetChild(i).name == "Quest Panel(Clone)"){
                Destroy(questPanelParent.transform.GetChild(i).gameObject);
            }
        }
        
        //2
        questTextObjects.Clear();
        
        int nameCount = QuestManagerPlayer.instance.questMarkerNames.Count;
        
        for (int j = 1; j < nameCount; j++)
        {
            Instantiate(questPanel, questPanel.transform.parent);
        }

        for (int i = 0; i < questPanelParent.transform.childCount; ++i)
        {
            questTextObjects.Add(questPanelParent.transform.GetChild(i).gameObject);
        }

    }```
#

So what im doing is deleting all quests on start, then if the list is only 1 it wont instantiate, but if the list is higher than one clone. So the issue is i can't seem to inject the text to each quest panel. What is happening it will register the first quest. ill press the button its on the list. then ill talk to another npc to get second quest. press the button both quests are on there. But then if i press the quest button one more time both quest become the last one registered the

#

this is the best i could achieve. the one above i thought i could create a new list and add the text game object to it and then loop through that way, but just no luck

#
    {
        for (int i = 0; i < questPanelParent.transform.childCount; i++)
        {
            if(questPanelParent.transform.GetChild(i).name == "Quest Panel(Clone)"){
                Destroy(questPanelParent.transform.GetChild(i).gameObject);
            }
        }
        
        //2
        int nameCount = QuestManagerPlayer.instance.questMarkerNames.Count;
        
        for (int j = 1; j < nameCount; j++)
        {
            Instantiate(questPanel, questPanel.transform.parent);
        }

        for (int i = 0; i < nameCount; i++)
        {
            Text ButtonText = questPanelParent.transform.GetChild(i).GetComponentInChildren<Text>();

            ButtonText.text = QuestManagerPlayer.instance.questMarkerNames[i];
        }
    }```
mortal robin
#
var instance = Instantiate(questPanel, questPanel.transform.parent);
instance.GetComponent<Text>().text = QuestManagerPlayer.instance.questMarkerNames[j];
#

you don't need a second for loop

#

Instantiate returns the object it created

#

that being said the fact that you seem to be instantiating from an existing object in the scene is really weird

#

Use a prefab

haughty drift
#

The thing is because i already have and original quest panel, i don't want to call instantiate until there is more then one quest added because then i would have an extra quest panel.

mortal robin
haughty drift
#

and i also get this from your snippet

mortal robin
haughty drift
#

its a child sorry

mortal robin
#

which makes sense because your code was using GetComponentInChildren

haughty drift
#

quest detail is the text component

mortal robin
#

right so use GetComponentInChildren

low pike
#

@haughty drift didn't bother following that guide, for spawning prefabs correctly, I gave you then

weary umbra
#

Hello every body
I am working on a simple project to create a pong game for android.
I wanna add a movement controller to the left paddle (Like the Football games do) but i feel it gonna distract the player from tracking the ball in his side.
Any suggestions ?

haughty drift
rotund dawn
#

Hello, how do i create textmeshpro object that is lighted? its always emissive.

haughty drift
pliant hound
#

So I'm trying to set up controller navigation on my UI but I seem to have run into an issue. When I try to force select a Button It stays stuck on the previous button. And if I try to make select null, to then set the target button as selected I get "Attempting to select while already selecting an object." Any easy solution for this?

remote birch
#

are there some good GUI tutorials. that also show scripting possibilities (eg: opening and closing a gui via cs)

rain tinsel
#

Hi. I'm making a world space UI. I find it very hard to edit because each component uses world units (the UI is small). Is there a workflow where I edit it in 2D for it to display in 3d?

#

Also, alignement doesn't work

#

Btw, my use case is basically a screen that is inside the cockpit of a ship

rapid ferry
#

i wasnt really sure where to put this but i was wondering how i would take something like this and import it into unity as a font asset? i made this in adobe illustrator if that helps

pine radish
#

Does anyone know if TMPro supports variable fonts?

sterile wedge
pine radish
#

So rather than having to manually create a seperate font asset for each permutation TMPro would ideally just load the one file and extrapolate from there

low pike
#

No. TMP only uses the SDF asset you create from your font

jagged monolith
low pike
#

parent scale should be small (my goto is 0.02) and then every child scale remains at 1,1,1

rain tinsel
#

Thank you!

#

Will try that

faint bane
#

Hey, does somebody know how to achieve this?

sterile wedge
#

i'm assuming you're using a grid layout group

low pike
#

should be able to do it with nested layout groups

Parent with a vertical horizontal layout group.
Two children for the rows, each row has a horizontal layoutgroup on it.

faint bane
#

I've never heard of layout groups

#

I was doing this

#

Pixelated was my camera

#

"Image" is a transparent rectangle, that fills the entire screen

#

and there are 3x21 buttons

rain tinsel
rain tinsel
low pike
# faint bane I was doing this

this doesn't show us anything, we have no idea what components are on any of these GameObjects. As far as we know they're all empty GameObjects

rain tinsel
#

a question on TMPPro. I'm using a script to set the colors of the TMPPro material to an HDR color consistent with the rest of the UI (for it to consistently glow). However, the color is not consistent although they are exactly the same color (the 1387 should be the same color / glow as the blue health bar). How can I fix this?

urban token
#

So for a UI image is it possible to edit the Raycast Target or is just fixed as a rectangle?

thick anchor
#

I have a world space ui and the image is transparent

#

How do i fix

tame escarp
#

Im using Cinamachine for my camera but when I use it my healthbar also moves even though it's supposed to stay still can someone please help me with this issue?

crisp oracle
#

currently, the way my tabs system works is by dragging all the tabs GOs into the "on click" event on each tab button and setting the other tabs to "disable"

This feels like a very tedious way to implement a tab system, is there an easier way to do tab UI?

mortal robin
frigid cobalt
barren barn
#

How to fix this issue

low pike
# barren barn

that's not a UI issue.
Find out what is on line 38 and null.. then make it not null.

I assume that's not your code though, perhaps an asset you bought? Contact the developer of the asset.

weak dew
#

Running into an issue, I cant really describe it but the position of a UI element is different depending on whether I'm in full screen or not. Has anyone ran into this?

worthy dragon
low pike
#

Make sure you're not using 'Free Aspect' on the game view

weak dew
#

I'm messing around with the anchors but they are still being set in the wrong positions depening on full screen. Is it because I'm hard coding its position?
CardToolTipParent.position = cardTransform.position + new Vector3(150,70);

mortal robin
low pike
#

Don't set the position on UI, set ... that ^

#

.postition sets the world position, not the UI's RectTransform.position.. the two are different

weak dew
#

What should I be setting the anchors to if I want to make its position consistent? Basically, I have different card positions but I want them to appear on the X,Y of the hovered card all the time

rocky quartz
#

Hi, I use a 2d sprite for a crosshair and its slightly compressed in scale when im in game tab. Is it just because the game tab is also not fullscreen or is something buggy?

low pike
potent ore
#

Can someone explain why the onClick menu looks like this and how can i get it back to the old one?

weak dew
low pike
#

well, I'd have a "tooltip" parent, which has it's top left anchored to the top right of the card... then the tooltips are children of this parent. Put a vertical layoutgroup on it

weak dew
#

Also, I have the setup you mentioned atm minus the anchor

low pike
#

It would have to be a child of the card

weak dew
#

It's because the card its parenting to is tweening sometimes so the scale will be inconsistent unless i make a coroutine that checks its current scale

low pike
#

well, not a child of the card... a child of something that also has the card as a child

weak dew
#

Why is that different than having the tooltip be a child of the same canvas? They are both using the same scaling

low pike
#

why is what different

weak dew
#

I have a recttransform called handgrid which contains all the cards

#

the canvas object of the grid is called CanvasCardGrid

#

is there a difference between me having the tooltip be a child of HandGrid vs CanvasCardGrid

#

the reason I ask because I want to use this tooltip object for EVERYTHING, not only cards

low pike
#

right, so what would probably be best(?), at least easiest.. would be to set the pivot of the tooltop top left, anchors set to top right. And when you spawn it, set it as a child of the thing it's a tool tip for, and set it's position to 0,0 + any offset you want

#

move it around, keep changing the parent

void solstice
#

Hey, I'm working on a map system for a 2D metroidvania. I already have the minimap functioning and the map is going to use the same camera/render texture to display the map.
The game will definitely be paused when accessing the map screen, but my question is

is it acceptable ux design to have the map be accessed by first pausing, then pressing a button to switch the menu over to map mode? or should I really work on giving the map its own dedicated button that can be pressed during play to pause the game and go directly to the map screen?

mortal robin
void solstice
#

definitely will do that, I'm just indecisive on my starting point

#

but I think I will go with pause game > press Right bumper/some keyboard button to access map

#

ooh, or maybe I could rework my map UI all together... have different tabs for map, equipment, stats, options... and have it remember which tab you were on when you last paused

#

I like that idea more, my current pause menu is kind of a first iteration anyways

worthy dragon
#

There a plenty of options UX wise. In general: Use behavior that Users already know (Key "M" usually opens a map). Use the fastest possible way to get to the goal. (One Button press instead of two).

void solstice
#

yea, I'm not trying to reinvent the wheel of pause screens

#

just thinking of what will work best for my game

jagged monolith
blissful chasm
#

Hello! For everyone here working on UI, check out this message in the announcements channel:

#📢┃announcements message

*`Hi everyone,

We’re continuing to develop the functionality and experience of ui-toolkit, our newer UI Framework, and The UI team is looking to understand users’ needs and workflows in order to identify areas of opportunity for improvement.

If you have experience with building or designing UI, we would love to get your input via a brief survey which is designed to take no more than 15-25 minutes of your time.
At the completion of the survey, you will have the possibility to opt-in for a follow up interview, where you share more in-depth feedback directly with the team. If interested, you might also be involved in providing feedback on potential prototypes of new features as we address the feedback received.

As always, we value your feedback and ask that you provide your candid and honest opinion.
Please click on the link below to start the survey: https://unitysoftware.co1.qualtrics.com/jfe/form/SV_9Ldsz0Ral8nndNs?channel=Forum`*

low pike
weak dew
#

What is the cause of positions getting messed up when converting from Screen Space overlay to ScreenSpace camerea?

I created all the positons and movements while testing with ScreenSpace Overlay but now I need to use ScreenSpace camera to use the trail renderer effect for my UI

balmy yacht
#

Camera space uses a distance and can also be either perspective or orthographic. Based on those settings, you'll get wildly different results.

weak dew
#

So I need to adjust the values of everything? Also I'm simply using a transform position of an element yet the element being set is no where near it

#

Both are using camera space

#

It seems like Input.MousePosition might be a good clue to why its doing this. Input Mouse Position is not accurate under camera space

balmy yacht
#

So, an overlay canvas uses pixel size, which is why it's so huge. It's set to your game window size or your monitor size if you're using an aspect ratio instead of a constant pixel size. It has no relation to the camera at all. Camera space, on the other hand, is driven by the camera, and will change depending on the camera settings. Therefore, the positions you set in overlay have no relation I'm aware of to the positions you set in camera space. Maybe Unity tried to approximate them or something when you switch back and forth, I'm not sure.

#

As for Input.MousePosition, you probably need to convert it using ScreenToWorldPoint, but that's just a guess without seeing your implementation.

weak dew
balmy yacht
#

What are the elements if not sprites? 3D objects?

weak dew
#

one thing I noticed is that when turning on pixel perfect, only the text is displayed everything else is hidden

balmy yacht
#

Images on a camera space canvas exist in world space. You can see this if you place a 3D object in your scene and change the Z position of your image so that the image moves in front of or behind your 3D object.

low pike
#

This looks like you're both getting wires crossed.

weak dew
#

So its like a sprite? I have made sprite versions of the card before. I tried moving the Background of the Z axis but it still remains the same

low pike
#

UI is still in world space, in the scene. It may not be set to a world space canvas, but it's still in it.

#

The SpriteRenderer here, isn't relevant.

weak dew
#

I will try using ScreenToWorldPoint for the mouse position and see what happens

#

This appears to be working:

rapid ferry
#

I'll be animating it a bit, I just hope it's not too visually noisy

primal tusk
#

For some reason, I can't see my UI until I move any setting on my camera, and I can't do it through animations either. Any fixes for that?

half thorn
sterile wedge
#

What's your current unity version

#

It's a unity bug. They fixed it in a later version

half thorn
#

@sterile wedge

rapid ferry
# weak dew

Pixel perfect has a bug where if the image's Z scale is 0 it won't show

#

(I had this issue before)

#

Also make sure you check the parents and that their scale on the z axis is not 0

weak dew
#

got it

sterile wedge
viral trout
#

Hi! Can anyone tell me why my text is so blurry in splitscreen? It works fine with only one player

gentle rune
#

Stupid question, but how do i lock the window size/scale the game acordingly?

i want it to look like this, game on the left, UI on the right, but if i play it in fullscreen mode, the window expands on both sides, making it look a bit to zoomed out!

#

Any way to work around that?

mortal robin
#

if you allow any aspect ratio, your layout is going to be able to be skewed by different aspect ratios

#

And if you want the proper UI proportions at any resolution, you will need to set the canvas scaler mode appropriately

sterile wedge
#

If you're using the former, use the latter

viral trout
#

@sterile wedge It's textMeshPro

quick willow
#

Anyone know how to make the Hitbox of the Slider larger? it has a really weird hitbox. and i can only click and drag it from the completly left side of the Slider.

torn marlin
#

I'm using Textmeshpro for my text in game, but it's causing a major problem. My HUD elements are in camera space so I can use shader effects on certain aspects of it, but these materials break when certain shaders are activated in canvas, when a textmeshpro object is activated, however, it overides the canvas settings to forcibly turn these settings on.

Is there a way to make my canvas keep all additional shaders disabled, or, barring that, a way to overide the canvas shader settings for specific UI element objects?

#

Do I need to bite the bullet and make an entirely seperate canvas just for my text, so it doesn't override my shader settings in the canvas?

#

Nevermind, I found a solution. If I add a canvas component to a UI element, it overides the parent canvas settings for additional shaders.

frank talon
#

(2021.3.7f1) When I create new font via Font Asset Creator I cant assign it in Font Asset Component. On an older version (2020.3.37f1) everything is fine. (TextMeshPro)

cold root
#

I followed this tutorial to make a menu bar but the panel is hiding when I mouse from the first button in the dropdown to the second https://www.youtube.com/watch?v=-FcrLi49RTg&t=297s

A quick a dirty tutorial showing how to build a drop down menu in the new unity UI system in less then five minutes. Made with Unity 4.6.


Feel free to ask questions in the comments and I will respond as soon as I'm able. You can find source code for all of these tutorials over at https://bitbucket.org/BoredMormon/youtube-tutorials

If yo...

▶ Play video
silk coral
#

why isnt the white box appearing at the top right of my screen?

#

i set its anchor to the top right but its barely budging

#

**top left

#

not top right

#

ah nvm figured it out, its a child of an empty

smoky tendon
#

Does anybody know how I would make something like what I have in the diagram? Sorta like a slider that outputs different values, but you can click on the plus and minus to make the "slider" go up and down. I'm not sure if something like this already exists or not.

#

like the thing at the top, but in this brackeys video he never actually uses or explains how to do that.

mortal robin
smoky tendon
mortal robin
smoky tendon
#

oh I get what you're saying, I was thinking of something different

#

So I can make a really simple image like that and set the horizontal fill, and it will give the appearance as if it's individual buttons

#

oh god those circles look abysmal

#

wait I'm stupid, I just need one circle and can set the texture mode to repeat 🤦‍♂️

smoky tendon
#

I've got it figured out. Tyvm.

rapid ferry
#

Woo!

#

Just gotta do more animation on the buttons

#

and some minor adjustments

smoky tendon
#

that looks really clean

rapid ferry
#

Thank you!

exotic coyote
#

Hi I'm having problems with OnMouseOver since I added the canvas. Inventory canvas has Graphic raycaster off. EmptyCards don't react when I hover over. Any help would be appreciated

mortal robin
exotic coyote
mortal robin
#

Yep, you should use IPointerEnterHandler

#

Physics raycaster on the camera.

exotic coyote
exotic coyote
cold root
#

I have a panel with a pointerexit event set to make the panel inactive but for some reason it's triggering when the mouse goes halfway down the panel

rapid ferry
#

Why was I pinged here wtf lol

cold root
#

found out it's because the pointer exiting a child element triggers it

#

is there a way to make that not happen

potent ore
#

is there an option to make the buttons on a menu being tilted to the right side?

sterile wedge
#

world space UI

near coyote
#

how do i make this TextMeshPro text stay the same size throughout multiple resolutions?

jagged monolith
#

Is the canvas set to scale with screen size?

near coyote
#

oh thats a canvas setting

#

ok yeah that fixed it lol

potent ore
#

thank you

azure tinsel
#

What determines view priority in the ui, I am playing around with toggling and even though I have an element closer to the camera that should block another one behind it the one behind it is coming out on top of the one in front. Why is this? (only happens in render mode)

mortal robin
azure tinsel
mortal robin
worthy arch
#

Hey there, we are looking for some Agencys that want to try out our B2B UX/UI Design service. We are a Designteam from germany and want to connect to some more development focused Agencys, to colaborate on some client projects. Working together is often super benefitial as clients tend to be willing to pay mare for software, that looks nice and is well thought through. Pls DM me if you would be interested in working with us 🙂 ! https://www.knguru.de

Wir sind die Architekten für deine App! Über 100 Startups uns Scaleups haben bereits mit uns ihre Apps konzeptioniert und designen lassen. 5 Sterne auf Google - 100% zufriedene Kunden

dapper idol
#

Is it possible to set transparency for a panel and all its contents?

sterile wedge
dapper idol
#

I was completely unaware of the component so I had to ask, thanks for this dude!

inland gyro
#

I'm having issues making the ui detection work properly for something I'm working on. Currently the detection has weird gaps at the top and right where it doesn't detect but should. This is what I'm using for the detection rn but I've tried sizedelta and all sorts of other things, nothing works. I only just got the position working and luckily it does, but the height/width doesn't.

Vector2 tl = new Vector2(rect.offsetMin.x, rect.offsetMin.y);
Vector2 br = tl + new Vector2(rect.rect.xMax*2, rect.rect.yMax*2);
inland gyro
# mortal robin Wdym by that

I have to have the ui calculate stuffs using regular numbers rather than ui elements. So I'm using the new-input-systems's mouse x/y and then the rects to figure it all out. So by detection I mean calculating mouse/point being inside the bounds of the ui boxes.

#

My bad for not good terminology ;-v-

mortal robin
#

This is what IPointerEnterHandler etc are made for

inland gyro
#

Though, besides; why wouldn't there be a way to do this in the first place, it's a simple calculation...

mortal robin
#

I mean I have no idea what you're trying to do

#

Probably recreating the functionality that exists in RectTransformUtility?

inland gyro
#

I'm just trying to get the proper width and height of a rect...

inland gyro
#

That's for converting screen space to rect-space as far as I can tell, the rect.sizedelta and xMax/yMax sorta stuffs end out negative which is most certainly not correct.

#

I've already got the positional calculations working, it's literally just acquiring the width/height that's the issue

mortal robin
inland gyro
#

While it's not exactly what I was looking for; seems that RectTransformUtility.RectangleContainsScreenPoint works for what I'm doing. Thanks for pointing me in the right direction and apologies for seemingly spinning around so much/being confusing ;-v- PraetorBlue.

rapid ferry
#

I just finished this shader for resetting my upgrade tree, it wipes across the screen - resetting upgrades nodes as the effect passes over it

frigid cobalt
rapid ferry
#

I am super happy with the result

#

Thank you!

rapid ferry
#

I have a small error I have to fix but other than that I am satisfied

alpine barn
#

Is it possible to have multiple rect transforms for a UI element?
Use case: I want a panel to scale with resolution / aspect ratio but have a minimum size before stuff starts overflowing

sharp furnace
#

hey, so I'm trying to make damage numbers for 2D game, and they won't display above the tilemap, even if I put them on canvas with the highest sort order :/

sharp furnace
#

not even changing the sort layer to the highest one works :/

low pike
#

because you've used worldspace canvas, and set it to -2 on Z

sharp furnace
sharp furnace
#

what kind of canvas should it be?

low pike
#

You can have it as world space if you like, just bring it forward on Z

#

this isn't relevant.. it only matters for the children of the canvas

sharp furnace
#

I set it to -2 on the z but nothing changed :/

low pike
#

it already is -2

#

put it 0 or higher

#

and play with different values.. don't just do one thing then stop

sharp furnace
#

ok

low pike
#

If it disappears, it's either gone behind the game, or behind the camera

sharp furnace
#

my cameras z is -10

#

my grid is 0

#

so it must between these values

#

except it isn't

#

it just disappears

#

and the highest I can set it is 7676 before it disappears

#

and the lowest I can set it is -0.01

low pike
#

The camera will still render world space UI even if one isn't assigned, that's for events.. and it doesn't even need to be assigned.

sharp furnace
#

hmmmmmm

low pike
#

select the floating points game object and show the inspector for that

sharp furnace
low pike
#

see how that's not UI, it won't use the canvas settings

#

You've used the wrong TMP

sharp furnace
#

ohhhhhh

#

ok

#

thanks 🙂

#

what tmp should I use?

low pike
#

.. the one under UI

sharp furnace
#

oh

#

lol

#

sorry

#

I don't use UI much

#

bruh

#

if I make it a TMP UI it doesn't even appear 😞

#

if I make it TMP text it does, but I get the same issues as before

low pike
sharp furnace
#

grrrrrrrrr

low pike
sharp furnace
#

ok that'll prolly work 🙂

#

nope

#

I switched the game to 3D view so I could see where they actually were

#

and I moved the text so I could see it was between the grid and camera and it did nothing 😭

fast sky
#

i have made a background image i want that image to cover full height and width without stretching it even if the edges are not visible how can i do that

#

the height is not enough so the black part is visible

low pike
#

Either add additional height in photoshop (increase the canvas size and add more sky/ ground), or you'll need to make the image fill the height of the canvas, and lose some of it on the left/right

pine crypt
#

I'd like to add a frame to one of my scene in the UI, so the whole screen is framed. Thing is, I don't want a transparent sprite covering 100% of the screen with opaque sides. It would be too costly for our game. I'd like to have a frame sprite but with nothing in the middle (no transparency, just nothing), how would someone do this ? Thank you

mortal robin
pine crypt
#

is this what you are describing ? @mortal robin

#

The frame we want will be 4-sided, but thank you for your answer, it convinces me having 4 tight images is the way to go !

#

Horizontal
Border
-Nested Horizontal with Border, empty, border
Border

mortal robin
pure hatch
#

Hi everyone, what is a good example of a nice keybinding settings UX to take inspiration from?

stoic jackal
#

Anyone know what this type of UI element is called ?

rapid ferry
stoic jackal
#

Not the label

rapid ferry
#

Isn't that just a cycling list?

frigid cobalt
rapid ferry
#

Like a variant of a drop-down menu except you cycle through the elements

#

Carousels are different, they usually have the options visible on adjacent sides

frigid cobalt
#

Sometimes they might do that, but carousel just means it goes round and round.

lament cliff
#

hello, im coming from ue background.

I have no idea where and how I should build an interface. In unreal there's the widgets editor where i can place the UI components visually and then plug it to game logic.

Do i use a manager object and write everything inside OnGUI()?
Is there an editor like the unreal widgets editor?

I'd appreciate some high-level pointers for going on about this 🙂

low pike
sharp oracle
#

If I have a UI element anchored to a custom width (say, 25% of screen width), is there an easy way I can make its height always match the real width? So if the screen resizes then I just have this thing being as tall as it needs to be to be a perfect square at 1/4 the width of the screen?

digital orchid
#

hello, i want to make a menu with tabs, that can be controlled using arrow keys

#

what the tabs have is decided before runtime

#

but if a tab is "available" is decided in runtime

#

my issue is how do i change the color so it's obvious something is selected/unavailable?

errant totem
#

why is my text under the image

digital orchid
low pike
errant totem
#

ok

low pike
grave surge
#

Why can I see a little bit of the progress bar when the value is set to 0?
How do I remove that?

#

How do I start the progress from nothing instead of seeing a tiny bit on the bar?

low pike
#

is it a slider?
are you sure that's the bar and not the handle?

grave surge
#

ah, yeah it is a handle

low pike
#

that's why you can see it

#

sliders aren't progress bars, they're sliders/ scrollbars

grave surge
#

ah okay

low pike
#

Use an image, with a sprite assigned -> set it to filled

grave surge
#

okay

gaunt kiln
#

hi, i have 4:3 game, im making a main menu ui, everything is fine in unity, but when building, most of the thing are streched out and font is really small

#

anyone know if its known and easy to fix?

sinful flare
#

I asked over in coding, and was pointed here. Something seems to be happening when I try to use Russian Font on strings. This is the scene with and without wordwrapping, and the debug for the words.

#

Here is a font asset I tried to use.

#

I tried the initial Unity font. as well.

#

I have 5 Font sets for 19 languages. Only Russian causes problems. I do not switch scenes for a language, just swap font asset and strings.

#

Certain letters seem to be acting as new line characters and I do get the occasional Invalid AABB in AABB error, but not with every time it is happening. This is the XML for the word "accomplished", one of the words that is not working. If anyone has any ideas to try, I would appreciate it.

eager saddle
#

you should be using 1 font for all the languages

sinful flare
# eager saddle i think it's using a regular y instead of cyrillic y

I will have to look into that. Since my fonts were different, I just created different Font Assets. It worked without a problem until Russian and in the end only 2 will be used at any given time. It is for a cross language learning RPG, base and target language can be changed. I actually have the word list for nearly 100 languages, most are Latin based alphabet, thankfully.

sinful flare
#

Doing 00-2FFF did not help. I am just going to put Russian on hold. Not even Chinese took this long to get working. Tried 4 different Fonts, all size combinations, and limited up to the bigger range of characters.

raw sleet
#

I'm trying to make a custom slider and Handle but I'm not sure how to make the borders for the gameobject whatever I try the handle always goes to far or not far enough how do I make the borders so the handle stops at a certain point when it hits 0 and 1?

sand wagon
#

can i know why my button appear in the scene but not in game ?

jagged monolith
#

Because you're positioning it in scene view, not game view @sand wagon. Try adding a button to the canvas again but this time leave it on game view when you adjust

#

The scales of canvas space and scene space are very different

sand wagon
#

ok i'll try

mortal robin
mortal robin
#

in the bottom left corner of the canvas

#

right where you put it

sand wagon
#

its ok i have already found it

#

thanks for info btw

grave surge
#

How would I make some scrolling text like this?

#

How do I get the text to move?

low pike
#

it's probably just moving the recttransform

grave surge
#

hmm

eager saddle
#

sounds like you found a real bug

sinful flare
rapid ferry
#

Hello I have a problem. When I start my game and the scene changes, I can't press buttons in the UI because the mouse pointer doesn't appear. I have the event system in the scene

mortal robin
spring wyvern
#

does anybody know how to change the hitbox of the button? I want to make is as big as it actually is

wary mauve
spring wyvern
#

It worked, thanks :)

wary mauve
low pike
spring wyvern
#

there is no text because its a part of the image, I couldnt find a good font 🤷‍♂️

low pike
#

oh right

#

The white lines for the RectTransform don't like right, would expect to see them hugging the image, but they're much larger height wise

#

scale of everything at 1,1,1 ?

spring wyvern
low pike
#

UI should always be at a scale of 1,1,1. Use the height/ width values to change the size

spring wyvern
#

oh okay thanks

marsh cliff
weary flare
#

Why does Unity have such a back-ass way of linking the ui resolution with the game resolution? So when you set the resolution to normal or low it pixellates all the ui? Is this just a web GL issue

Basically trying to keep the game resolution and the ui resolution independent from each other. Is that possible at all?

mortal robin
#

but yyeah if the actual game resolution is low and you're upscaling the window or in fullscreen, you will get pixelation

weary flare
#

Is there any smart way to disconnect the two? Like in normal unity games, if i change the resolution of the game it doesnt do that with the ui right

#

or maybe it does and I'm just having a selective memeory

mortal robin
#

if you want a "pixellation" effect on the gameplay you would either use postprocessing or you would render the game itself in a RawImage on the UI with a Render Texture

weary flare
mortal robin
#

is this for the 64x64 game jam or something

weary flare
#

I just wanted it to stay sharp (icons text boxes etc) independent of resolution changes

#

Now just for web gl game.

mortal robin
#

Oh

weary flare
#

Is that different then

mortal robin
#

actually you're struggling with web browser canvas weirdness sounds like

#

not really a Unity thing

#

Like I think you'd need some javascript that sets the canvas resolution properly to keep it 1:1 with actual screen resolution? I'm not a web dev expert

weary flare
#

The ui is created in Unity. I'm actually a prodcut designer.ux person so I'm just curious really

#

We have some react elements of the ui and ofc that stays super sharp

mortal robin
#

Yes I know that but the web page/Canvas itself may be upscaling things to keep the canvas at the size prescribed in the CSS on the web page for example

weary flare
#

but unity turns into a blurry mess with any resolution and graphics change

mortal robin
weary flare
#

game resolution

#

canvas scaling is fine

mortal robin
#

to a lower resolution?

weary flare
#

to a lower one yes as a test

mortal robin
#

but without changing the size of the canvas element in the HTML/DOM?

weary flare
#

You have lost me I'll have to check

mortal robin
#

basically the unity game renders within a CAnvas which is an HTML element

#

if that element doesn't change size, but the internal resolution of the game changes... something has to give - the browser will probably upscale/downscale the game to match the canvas size

#

something like that

weary flare
#

Yea thought so...

#

oh well 🙂

mortal robin
#

that can result in pixelization

#

you'd have to simultaneously change the size of the canvas and the game resolution to keep it in parity

weary flare
#

Is that answer in this correct do you think?

#

Yes, set all of the textures used in the UI to GUI type in the project window and that should exclude all of those textures from getting downsampled.

#

?

rocky quartz
#

Hi, does someone know how I can make "animated" Hitmarkers ? I dont know if you achieve this by just scaling and rotating a 2d sprite or in another way.

mortal robin
#

Or you can use AnimationCurves and do it yourself in code

#

Or use DOTWeen

rocky quartz
#

DOTWeen looks interesting, thanks i'll give it a try

primal heron
#

I am rendering a camera onto a plane, the camera is also rendering this ui but the ui is underneath the objects the camera is rendering, how do i make the ui be overtop of the objects?

mortal robin
tall shale
#

How do I scale the UI to cover the camera ??

primal heron
primal heron
#

@mortal robinnvm just had to set plane distance to 1

hollow karma
#

I'm trying to make a game that replicates the chat window from Gunpoint. Does anyone know what kind of tools/tutorials would point me in the right direction? https://youtu.be/kP6Uz5wnRb4?t=1242

Many thanks for watching. Subscribe for more full games.
Please note that any cross-fades in the video are cuts in the recording.

» Get "Gunpoint": http://bit.ly/buy_Gunpoint
» Game Description (Wikipedia):
Gunpoint is divided into a number of missions, between which the player, as Richard Conway, interacts with others through a PDA to accept m...

▶ Play video
empty juniper
#

TMPro
How the f does the color of the outline work? I have spent 20 minutes trying to get the color I want and i don't get what i am doing wrong

smoky tendon
#

Does unity have a drop down menu that doesn't require a toggle? I want a drop down menu that's basically just a way to hide some gameobjects
edit: nvm just gonna make my own

empty juniper
frigid cobalt
cosmic herald
#

Do the standard UI components have the option of scaling compared to their parent object? like i want the width to be 2/3 of the panel object that is a parent for example

#

Like here i have a simple loading screen and want to make sure it scales well on all different formats, i already use my canvas with the height matching

#

So here i would like to make sure the loading bar is always 2/3 for example of the total screen width

mortal robin
#

Read the doc page on "auto layout"

hollow karma
gaunt kiln
#

hi, i have 4:3 game, im making a main menu ui, everything is fine in unity, but when building, most of the thing are streched out and font is really small
anyone know if its known and easy to fix?

mortal robin
low pike
#

dont have the game window set to 'Free aspect' when working with UI

rugged atlas
#

I have a problem with the TextMeshPro Input Field. Every time I input stuff and then click another TMP Button I can't go into the Input Field again. Do I have to enable something or what's the Problem ?

crystal plank
#

why is my image looking like this?

#

it looks all pixelated

north reef
#

Hey guys! I just learned that Animators set Canvas to dirty and force it to rebuild itself every frame. Does anybody know if this also happens if using Animation component instead?

open vector
#

Are there any referenceable resources for making a scroll view where the current focused item is the brightest and largest, with the other items scaling down like a wheel of some kind? UnityChanThink

tidal osprey
#

hello, do you know why my canvas and it's content are not visible in the scene when I press play ? The canvas is set to world but it's position seems correct.

Even if I move in the scene (so not using the camera) the canvas showing the lifebar is empty, and the values are correctly set. Any idea what could be wrong ?

#

the fill value is also set to 550