#📲┃ui-ux

1 messages · Page 33 of 1

plucky gulch
#

how can i use vertical group and make all childs expand as much as they need

#

for example i got Root containing 2 elements, they arent the same size
the second element has a fixed height of 300, so the first element should take all the remaining space

but as you can see with the req area, the second element takes half the space

#

if we look at the child of the root of the prefab (second element in the vertical group), we can see it only needs the 300 px of height

#

globally, the idea is to have multiple elements in a container
each of these childs can decide to expand or not

tepid marsh
#

Im making a card game and without text the cards are 1 batch (image 1). When I enable text on my cards if the text is on top of another card it first draws the card, then text, and then the next card etc (image 2). If I take all the text from my cards and separate them I get 2 batches (image 3) but then the text is not a child of the card and wont follow. Whats a good way to get the cards to be 2 batches?

swift basin
#

Can I make a vertical layout have like two columns? Like....

subtle pilot
#

or I think a grid layout group would be better

swift basin
swift basin
subtle pilot
vapid edge
#

I kinda got myself into a corner, and fixing things would require a lot of refactoring so uh...
Is there a way to make particles from a particle system render DIRECTLY on a canvas? Or do I have to use a render texture (please no), or make my own particle system (please noo)?

mortal robin
honest saffron
#

did you make it manually or from the option that automatically creates a scroll rect for you with all the necessary parts?

#

yes

#

maybe you accidentally changed the anchors for one of the objects?
you can create a new scrollrect and compare to see if everything is right

#

wait you added stuff inside it? it already had a content and viewport didnt it?

#

did you make the anchors of this new object expand in every direction so it matches the parent?

#

can you show the anchors of the objects that you created?

#

i think you have to make them match the parent

#

for all the objects that you created yourself and manually inserted in there, make them stretch in all directions and set the four numbers on the right to 0

#

left, top, right, bottom

#

no i meant the numbers above those

#

the left right top bottom ones

#

and you forgot to stretch it

#

actually no dont change the achterground and stapbuttons

#

what else did you add here beside those two?

#

no sorry, isnt View or Content supposed to be stretched? can you create a new scrollrect and check it

north barn
north barn
#

^ forgot which room i was in :/

rain marsh
#

Hi, I would like to narrow down the area where the individual options are located. I would also like to have only 5 options displayed and scroll between multiple ones. Can someone help me please?

sonic sphinx
#

Hi can you guys help me when I build this on android thee caret isnt showing

#

while on simulators it does indeed worked

low pike
#

google -> tmp caret missing from input on android

ripe pelican
#

Hey, guys! I would like someone to remind me how to separate layer masks for UI elements

#

I have 2 images and my second image doesn't seem through camera

#

I have them at the same place

low pike
sonic sphinx
# low pike google -> tmp caret missing from input on android

I searched for answer and based on it I need to uncheck Hide Mobile Input which on default is already false, I also tried to thicken the caret as I thought its just invisible but the thing is I cant select the text so Im certain that its gone

flat thicket
#

hello

#

I added this slider thing

#

and for some reason it's not appearing 😦

#

in the game

#

but it works fine in the scene

ionic beacon
#

It's outside the canvas

flat thicket
#

also why can't I move the canvas

ionic beacon
#

You don't move the canvas, you move the UI elements inside it

flat thicket
#

oh ok

ionic beacon
#

UI elements are shown separately from gameobjects in the scene view. You have to use the game view to position them where you want

thorny magnet
#

I want to make a ui that appears on a screen of 3d modeled monitor in game. How do I go about doing this?

thorny magnet
#

I mean how do I get ui in material of screen

#

The shader

#

Not just on top of it

thorny magnet
jagged monolith
#

That's more work, especially if you want it interactive. You would probably go via a rendertexture and use that in a material setup

north barn
#

any idea why the Canvas (it was created when i made a TMPro Button) set this automatically, and the gives me the message below it?

#

Oh, i see i misread. that is a Screen Space - Overlay specific issue. Screen Space - Camera has no such warning

vapid edge
#

Due to some infernal unity shenanigans, I cannot stack my canvases (as in make them parent-child objects of each other), but I need to ensure that almost all settings across them are 100% identical - except for render target and culling mask. Is there a way to easily ensure that?

honest saffron
cloud vale
#

I'd like to create a label system for easy create a label on 3d model (image reference.)
I don't wanna know how to do that specifically but some higher tips to implement the graphics.
I want a point (circle) on 3d model, a line and a box where insert some text.

I'm using Unity, do you recommend do it with line renderer and 3d object or with shader?

small jolt
#

Is there a way in Unity (not the UI toolkit) to configure colors of the specific UI elements? For example if I want to change only the green elements of my action bar.

mortal robin
thick flint
#

my object wont display an image nor raw image

#

no matter what i do

#

it has a custom skin renderer

#

it's a store asset so not my code

low pike
#

1- read the docs from the asset
2- contact the asset publisher for help
3- !ask

onyx flowerBOT
small jolt
#

What is up with scrollbars? I'm one second away from tossing my computer out of the window and while some people would probably pay to see that I'd love some help.

#

I've got a vertical scrollbar set up in my inventory. And no matter what, I cannot change the anchor. But I have to, because the scrollbar parent positions the scrollbar so dumb and stupidly that it makes scrolling impossible.

low pike
#

looks like you're trying to change the wrong thing

#

I THINK the recttransform you need to changing is the Scrollbar Vertical

small jolt
low pike
#

you're gonna have to record a video showing what's going on

small jolt
#

This is how it looks in game.

#

It is utterly fucked now.

low pike
small jolt
#

Will do when I re-did it

#

Deleted it and starting over

small jolt
low pike
#

I believe it stretches because it doesn't need to be small, what you need to do is 9-slice that image so it looks correct

#

The size of the scrollbar depends on the content. See how it works in explorer, the scrollbar that you drag changes size (getting smaller) the more it needs to move

#

slider_n needs to be 9 sliced, and IIRC the image type needs to be changed to whatever is the correct one for a 9sliced image

small jolt
#

I'll test it with the 9 sliced image

tranquil nexus
#

want to render vfx on canvas

#

screen space camera canvas into a camera with render texture into image on overlay canvas for the main cam?

#

unsure about overheads

tranquil nexus
small jolt
tranquil nexus
#

any other solution?

tranquil nexus
low pike
# tranquil nexus want to render vfx on canvas

The Shader Graph team is excited to announce the release of our newest set of samples - UGUI Shaders - available to import now in Unity 6. This set of samples contains over a dozen user interface widgets, buttons, and backgrounds - all generated procedurally using Shader Graph. It also contains a library of more than 50 UI-specific subgraphs t...

▶ Play video
tranquil nexus
primal ermine
#

pls tell me I'm not going insane
Left is the color I want, which isn't being displayed properly (I think)
Right is result of using the eyedropper tool on the image selected on the left

mortal robin
primal ermine
#

the original image file is pure white

mortal robin
#

I'm not sure what kind of processing or filtering etc may be happening in scene view exactly

primal ermine
#

none, it's a blank scene, created using the default 2D URP template

mortal robin
#

I'm not saying you added any

#

I'm saying Unity may have some by default

primal ermine
#

Ah I see, is there anywhere I can check that? Maybe in Quality?

mortal robin
#

like postprocessing

#

also game view is the more important place to be looking

primal ermine
split cypress
#

trying to follow tutorials on how to make a scrolling panel with scroll rect, but I can barely scroll through my content before the elasticity snaps me back to the top. anyone have suggestions?

plucky gulch
#

can I change the order of UI elements in one single canvas without changing the hierarchy ?

#

basically i need a nested child to be rendered on top of a parent layer

#

and since i have some heavy layout setup (a bunch of vertical boxs and so on) i cannot change hierarchy

subtle pilot
# split cypress

your viewport's rect seem to be where that second image is masked and because it's on elastic, it's letting you go a little lower. if you set the movement type to clamped, how does scrolling look?

split cypress
#

doesnt scroll at all

#

stuck in place

subtle pilot
#

yup then it's your viewport's rect. lower it down more

split cypress
#

lower as in transform?

#

or elongate downwards with the scale

subtle pilot
split cypress
#

cant adjust them past the 100%

subtle pilot
#

Are you pulling that down? Not the blue dot, the other one

split cypress
#

yes

#

took the screenshot while that was held

#

i can go inwards but not outwards

subtle pilot
#

I see that it's very high up. lower it down further

split cypress
#

ya those were at 0%, and when i bring it to 100% still nothing changes

subtle pilot
#

Try using the rect scale instead of the rect transform

#

Should work like shown

cloud bloom
#

Hello.
Is there a way to tell a horizontal layout group what direction it should expand? I have a Panel with a HorizontalLayoutGroup and a ContentSizeFitter. The behavior I'm attempting to get is that the panel expands to the right when a new element gets added to it. However, I can't find a setting to tell it to do that, right now it expands both ways.

split cypress
#

nothing to expand

subtle pilot
cloud bloom
subtle pilot
split cypress
subtle pilot
#

that's weird then. try removing the content size fitter on the Content because it seems to be giving a warning? worth a shot

split cypress
#

still no difference notlikethis

subtle pilot
#

that's strange, i'm not sure lol. the content should be able to be editable

split cypress
#

rip, thanks for trying tho

#

does the problem happen to be related to the size of the parent?

subtle pilot
restive matrix
#

hi y'all I'm having some font trouble. I'm using unity UI (not toolkit) and TextMeshPro, with unity localization.
When I load up the panel, the fonts are all scrambly, then if I drag and drop the very same asset as a font asset, it loads properly.
Any ideas on what's going on and how to fix it?

thick flint
#

my code is 10 years old and i have a GUI.DrawTexture

#

but i read that OnGUI is antiquated

#

and that i should use uGUI

#

but rawImage doesnt work for me

#

i need to use GUI.DrawTexture

#

should i put it in update

mortal robin
#
  1. If your code works already why change it?
  2. RawImage works fine
  3. Graphics.DrawTexture also exists
thick flint
#

ah 3

#

where do i put Graphics.DrawTexture?

#

in update?

#

my code no longer works because i guess unity left it behind

#

it used to draw multiple boxes but now only one at a time

#

most likely because OnGUI is ancient and no longer supported

mortal robin
#

IMGUI still works, nothing should have changed there

thick flint
#

hm thats weird

#

why is my thing not working properly then

#

it only draws one box at a time

mortal robin
#

I couldn't possibly speculate without seeing it. I would recommend debugging it.

thick flint
#

how do i call the current game object

#

is it just gameobject._____

#

or transform.gameobject

#

this.gameobject?

low pike
#

You can use gameObject. and this.gameObject.

thick flint
#

ty i fixed it

#

it was cuz there was an null error in my code

small jolt
#

What's the best practice to add drag & drop to items within a scrollbar viewport?

https://youtu.be/0ZTtZXv3zfg

As you can see in the video, my drag & drop script is not triggered, despite having a canvas group on the icon telling to ignore parent groups (block raycasts is disabled), and all raycast targets of overlapping UI elements have been disabled too.

teal stream
#

why do I have a UI object in the editor, but not in the compiled one?

I can send the code

honest saffron
teal stream
cloud lintel
#

Is there a way to mask something without being a child of the mask?

#

Or is there a decent way to have the child ignore the anchors of the mask and use the anchors of the mask's parent instead?

small jolt
#

Hey everyone. I'm really stuck with this and I don't know how to fix it, I'd really appreciate the help.. I've documented everything.

Basically trying to create a drag & drop script in my inventory. The moment I drag an item, the item goes to the draglayer, but it isn't visible being dragged, and does not go to to the new slot.

I will share my code and videos showing my UI hierarchy.

Drag script = https://pastebin.com/HANqCbd9

InventoryslotUI script = https://pastebin.com/4axiT1Ds

Inventoryslot prefab hierarchy =
https://youtu.be/u7asWWFWKPI

Canvas hierarchy =
https://youtu.be/xbqBVSESeo4

I've already tested it in a minimal setup, the scripts seem to function there. But this is without a scroll wheel, basically only a canvas, gridlayer and inventoryslot..

I don't know if this is because of the script or the UI settings, but I've ran out of options after 12 hours of debugging. I'd appreciate a snippet of your time to look at this.

next pumice
#

Hey! can anybody help me with this? i'm trying to place my canvas inside of the TV.. everything works but the Mouse isn't aligned well with the canvas .. i tried to use World Space on canvas and attached the camera to it, but it doesn't work.. please help

low pike
next pumice
#

i'm using world space canvas.. i want it to be inside of tv. nothing else has colliders

low pike
#

I should be more specific.. make sure the recttransform is only covering the button size and not overlapping

#

press T to swap to the UI tools

next pumice
low pike
#

Like that yeah - make sure all children are the same

#

last time I saw this issue in here, the dev said it was because their TMP rect was overlapping

next pumice
#

they're not but i'll try to make them smaller just in case

low pike
#

If everything is within the white lines, that's probably not the issue and making them smaller won't help

#

I haven't got any other ideas to try though

next pumice
#

tried separating it but issue is still there..
:

#

yeah, i think it's something to do with canvas being small and camera recognizes it as small.. because it reacts normally in the center

#

but when you move cursor out of the place then it starts being weird

low pike
#

it looks rotated too.. I have had misalignment with raycasting from a vr camera when a worldspace canvas was rotated

next pumice
#

canvas isn't rotated but camera is.. i'll check if that fixes the issue

next pumice
#

I fixed it by adding Second camera for world space reference

low pike
dense hornet
#

Oh sure!

low pike
#

this chan is for the older UGUI

dense hornet
#

I figured this channel was more for like, general UI and UX of all types while the other one was for more advanced questions regarding the toolkit

#

Like with the coding channels

#

Thanks anyway!!

junior ether
#

Anyone have tips for rendering smooth TTF/OTF fonts (not originally pixel bitmap fonts) to look as pixel perfect as possible at a small point size using TextMesh Pro in Unity? It's for a pixel art game. I'm talking about tricky fonts like Freeride.
A while ago, I wrote a guide for bitmap fonts in TMPro. And I'm also aware of similar articles, like this one from Dan Liberatore. So bitmap-style fonts are no problem. But getting non-bitmap fonts to look legible at 16 pt is a challenge. Unity's legacy Text renders it better than TextMesh Pro, and other programs such as Photoshop do a much better job than that. The best I've been able to get is:

#

I'm happy to try any ideas you all can think of. In the worst case, I may end up rendering the font to a bitmap image in Photoshop (since Photoshop does the best job of this) and then importing it into TMPro as a bitmap font. But I'd really like to avoid this if I can since I need to handle a lot of fonts.

#

I don't have a Photoshop render handy, but it's significantly more legible.

unborn summit
#

I have lots of UI in my game and I am not sure if i should use ugui or the ui toolkit. The Toolkit looks very complicated and some people say its missing key functionalities

#

So is there any good guide on how to build clean, good looking, responsive UI's in Unity?

low pike
#

The biggest thing UIToolkit is missing is world space UI. Other than that I don't know what else is missing (probably stuff I just haven't heard about).

unborn summit
#

I was touching it some time ago and it was pretty inconvinient in terms of arranging elements

#

not sure if that was fixed or if i just didn't know some tricks about arranging things

low pike
#

Did you use the "Ui builder" ?

#

that used to be kind of a secret/ not an obvious to find tool

unborn summit
#

the normal UI toolkit, not sure what the builder is

low pike
#

it's a tool to help building UI in UITK

unborn summit
#

yes, i was using that

small phoenix
#

all the tutorials teach me lame movement of UI when it comes to animations

#

how do i animate my ui complexly with frames

#

kinda like the pizza tower TV in the corner

#

damn gif

#

its ui and its animated nicely with frames

#

but im told i cant use animator in ui

#

due to performance reasons

azure flame
#

Performance hit is from dirtying entire canvas, use subcanvas and it will be isolated.

small phoenix
#

can you go more in depth?

#

what is it and how do i use it

#

never heard the term

azure flame
#

Any canvas under main canvas is a subcanvas.

frosty pewter
#

The biggest thing it's missing is custom shaders

low pike
frosty pewter
small phoenix
brazen sphinx
restive matrix
#

and no, now that the repro is gone I don't think I can fill a reasonably reproducible bug report, so no point in filing it

brazen sphinx
low pike
grizzled inlet
#

Why is the UI on the stage so bright? I can't see anything to edit it.

mortal robin
#

but - presumably it is the way it is because you made it that way.

mortal robin
#

on its own it renders nothing

#

child objects of this one may be the things we are seeing

#

for example I would expect the big white background to be an Image component on some child object of the canvas

grizzled inlet
mortal robin
#

that's probably the one

#

change that color to whatever you'd like

#

looks like it's 100% white right now

shrewd minnow
shrewd minnow
mortal robin
#

If there's no camera there, nothing is going to clear that space to black between frames

shrewd minnow
#

i got a script to force the resolution, and it turns out that was the solution lol

regal cradle
#

Since my heathbar frame is in a slanted shape, do you guys know how to make the healthbar(red) slanted as well?

shadow pagoda
#

General inquiry...what's the current state of affairs with UI Toolkit in 6000? Is it great, easy to use, etc. or should I stick with Canvas and TMP that I've used forever?

spice creek
#

Hey so, Im working on a TD game. I want to have a small UI element like this as a buy/upgrade menu, and I want to ensure that it does not go off-screen.

How can I ensure that the menu appears above a tile when a bottom tile is selected and vica versa, like this example?

(Example from Mini TD 2)

mild kernel
#

Always attempt to position it below the tile, then check if the bottom of the rect ( you can look up how to get the height of the rect) goes beyond the screen height (can also look up how to get this).

If it does, put it above instead.

#

Similarly, for the sides, check if the left or the right goes beyond the width, and shift it over so that it offsets.

formal perch
#

guys why i dont have text only text

shadow pagoda
fast spade
mortal robin
thin furnace
#

For the life of me, I cannot get any of the button colours to display in scene or game. What am I missing here?

minor ocean
minor ocean
regal cradle
limber remnant
#

why does my UI suck 😭

subtle pilot
subtle pilot
limber remnant
subtle pilot
limber remnant
subtle pilot
cloud bloom
#

I'm trying to animate a panel to grow and shrink. I want the text inside the panel to truncate rather than shrink in size. To do this, I set the overflow setting of the TMP to truncate, and I'm lerping the sizeDelta of it to change the size. This works, however, when I grow the size I need to know the destination size. Is there a way to get how large the TMP needs to be for all the text to be visible? I mean, I could do a manual calculation with the character count and font size, but there has to be an easier method.

#

Do you guys have any experience in this?

#

So far I tried to use GetRenderedWidth() but I think that's returning the current size of the TMP not what is has to be with all characters visible

#

I can't save the size of it because the text itself can change

cloud bloom
#

OH never mind, that's preferredWidth and preferredHeight

livid ore
# limber remnant why does my UI suck 😭

You can:
1.Make the layout match with other elements
2.Your icon are a little old looking, you can use vector icons to make it lool good
3. Color the ui
4. Make the background darker (still blurred but darker)
5.Maintain the sizes

  1. Make the main foucus brighter
livid ore
high ruin
#

Hey I added a png to my unity project and changed it to 2d and sprite or however its called, but for some reason when I try to drop that image to an image component it doesnt let me do it

#

do someone know why does that happen?

#

It is as 2d and UI

#

but I cant use it there

livid ore
#

Try using the selector

high ruin
minor ocean
# high ruin

You have it flagged as "multiple" like it's a sheet of many sprites, so the whole thing can't be dragged to a single Image component. You probably just need to change "Sprite Mode" to "Single".

high ruin
#

oh, that solved it

#

thanks

limber remnant
#

really appreciate that

limber remnant
#

Which icon layout is best? (bottom is a menu that opens up)

livid ore
# limber remnant

first one seems perfect.
Its clean and modern and approachable for users

livid ore
limber remnant
livid ore
foggy harness
#

just started trying to make some UI stuff - for some reason TMP text doesn't show on my button but a TMP Text by itself does. Does anybody know what's happening?

low pike
#

these values probably push mean the text is off somewhere else on the canvas because the center is no longer within the button

foggy harness
#

thanks, you were right

foggy harness
#

I got a different problem now.. the buttons don't react at all to my mouse

#

I just dragged in the UI prefab into the scene and it's visible but clicking does nothing

low pike
foggy harness
#

Probably not

#

I’ll have to check when I get home

foggy harness
#

I just added it, but still no dice

minor ocean
#

Are you using the "new" input system? If not, you should probably replace that component beneath the EventSystem.

If that's not related, can you expand the inspector around your buttons and show one of your button's properties?

mortal robin
#

you would need to replace it with the StandaloneINputModule for the old system

minor ocean
#

Oops, I meant replace. Fixed.

foggy harness
#

how do I check what input system I'm using?

#

I've also noticed that I'm able to hit enter on keyboard and trigger the button, but not click on it... so that's probably important

minor ocean
# foggy harness

That all looks good for the actual button. I guess there's some chance some other element is blocking your buttons and preventing clicks, but this would let enter work.

If it's nothing like that, I'm guessing it's something in the 'new' input setup, although the defaults in the input system look like they would work, I don't have enough experience with that to know if there's a gotcha in there.

foggy harness
#

hm i'm pretty stumped atm

minor ocean
#

It shouldn't be. There is just no way to tell by the images if you have some transparent panel in front of everything for whatever reason when you created it. You probably don't, but sometimes stuff gets left behind and forgotten.

Nothing in the scene should block it as long as this is an Overlay canvas, which it looks like it is.

foggy harness
#

ok... I figured it out

#

it so happens that when I moved stuff around in the hierarchy I accidentally unparented the TMP text from the button, so they were blocking the buttons

#

hahaha wow

swift basin
#

So.... if I rotate the image, the anchors get fucked????

#

I want to rotate the image inside, not the whole rect transform, how do I do that?

heavy sentinel
#

Can ContentSizeFitter work for non-text objects if no LayoutGroup components are present? 🤔 Or do I have to add it every time?

low pike
heavy sentinel
low pike
graceful folio
#

Its crazy that for me to have a small ingame UI element with render mode sat to "World Space" I have to scale it down to 0.0001. Isnt there some better way?

low pike
foggy harness
#

I've tried adding a UI prefab underneath a different one, but it is not visible when I do this... is this not allowed?

#

nvm, just saw that the scale defaulted to zero (????)

lilac egret
#

ok this might be 2-field stuff but is it possible that i want a cool animated symbol like that made up of UI elements and they make this transparent/white image that i would than apply a shader to to create a glowing/firey effect?

#

or do i use smthn different?

mortal robin
# lilac egret ok this might be 2-field stuff but is it possible that i want a cool animated sy...

Unity VFX Graph:Use SDF to make model particle effects
Version:2021.2.17f1
Subscribe:https://www.youtube.com/channel/UCf3S-ovaTom4cc7rxwall8w
0:00 Intro
0:32 Start creating VFX Graph file
1:43 Set up SDF node
2:39 Make sample model
3:25 Using SDF Bake Tool
5:00 Number and color settings of particles
7:25 Replace different SDF files
10:09 A...

▶ Play video
#

doing it with UI though... not sure how you would.

#

certainly possible it could be done with a shader

lilac egret
#

so that the elements are all merged like 1 image...

mortal robin
#

That would be postprocessing

lilac egret
#

that sounds like something that will prob be difficult...

mortal robin
#

as I said, you would use a postprocessing effect

lilac egret
#

or render textures...

minor ocean
swift basin
minor ocean
#

You don't have to do it that way, no. You can change the size and rotation in the same thing. Or you can just leave it at the level you have and deal with the rotation there.

swift basin
minor ocean
silent orbit
#

How does one rasterize text in Unity 2022.3.7?

low pike
#

never had to do it, but interested to know the purpose of doing it

meager dagger
#

what else i could add for this (nuke game)

#

except money ui i forgot add it

subtle pilot
meager dagger
#

oh mb

swift basin
#

Am I an idiot or that Vertical Layout Group is not doing the Child Alignment correctly???

#

Shouldn't those two be aligned towards the top part instead of the middle?

foggy harness
#

The second screenshot happens when I zoom out enough. Does anyone know what could be the cause? this text is using TextMeshPro

low pike
# foggy harness

That's usually from not enough... padding? or something set when creating the font asset (sdf)

#

Having a recttransform scale and/ or font size set to < 1 can also cause issues

minor ocean
foggy harness
#

made it like this, do I need to bump the padding stat

#

or anything else looks off?

foggy harness
#

I got a different thing here - i made a progress bar and I want to reuse it in different scenes

#

but all the transform stuff is greyed out

ionic beacon
#

Screen space canvas can't be moved or resized. Make a new parent canvas object or remove the canvas components completely

#

or move the Background object

shut creek
#

someone know how to access to this through script ?

#

I want to, from a script, edit the Dilate parameter for a text

quaint karma
#

How would I go about making a UI curved like this? Should I make a shader and put it on the canvas layer or is there a better way? I believe they have some slight chromatic abberation but how to actually make it look like a helmet/3d?

low pike
low pike
signal tinsel
#

Does anyone know if there are any good tools/frameworks/libs to improve UI view creation/navigation? I used to use Doozy and thought it was amazing but it seems like its been discontinued 😦

I mainly want to be able to create each UI page/section as its own Prefab/View and indicate what button goes to what page as well as having some simple transitions etc.

frosty pewter
foggy harness
#

ok cool thanks, I will give that a go

low pike
spiral kernel
#

how do you stop this?

#

for example how do i force the edges to touch sides of canvas

#

why are there spaces inbetween etc 😭

low pike
#

because the image file used has space around it

spiral kernel
low pike
#

ok? might still have empty space?

#

It's not exactly done well is it, look at how awful the quality is

spiral kernel
#

yea its shit

spiral kernel
#

ohh wait

#

its because im using the background set

#

if i just remove that

#

it does normal colour

low pike
#

I use assets that do procedural creation of shapes. So either buy one of them, or do a better image, or remove and try the outline component

spiral kernel
#

however the background was fucking it

signal tinsel
# low pike You can still use the version of Doozy you already own.

My concern is the publisher has ejected from the asset store and I remember last time I used it there were some quirks with newer versions of unity, but I just assumed they would be ironed out over time.

If the last versions works fine though will pull that in (I'm on unity 6 for this project).

low pike
#

Try it out before paying for something else.

Eventually it probably will become unusable

spiral kernel
#

whats the keybind to move something along with its anchors?

swift basin
#

Can I not modify the anchors of an element on a Vertical Layout group??? I want the width to be relative to the parent but not a 100%. How do I do that?

honest saffron
steep warren
swift basin
#

The container is a vertical LayoutGroup

#

Layout Element just allows me to set it to pixels

honest saffron
#

oh you want a percentage? not sure if this is possible without writing code

swift basin
#

I want to give a text a % width padding, basically

steep warren
#

are you the person who was asking about auto width with same height in one of the code channels

swift basin
#

Yeah

#

Making somewhat complex UI be relative in size is like a total headache

honest saffron
swift basin
#

Like.... everything needs a freaking layout but layouts literally prevent you from using relative anchors and sizes like.... what the heck am I supposed to do with that?

honest saffron
swift basin
#

Yeah, code that I don't know how to make lol

#

I would die trying to replicate what a vertical layout does

#

Why does the layout element not allow for %based scaling?

#

How hard would be for me to modify that with code?

regal epoch
#

Any website I can get icons, like health, damage, range for ui ?

steep warren
#

(though there's a max height here, you could make that bigger if needed)

it's kind of a weird setup, i'll try to reduce it to what's actually needed before sending it to you

swift basin
#

I did a subclass of layout element that allows me to do a relative size in the end

#

Seems to kinda work

steep warren
#

i just used the built-in elements there

#

verticallayoutgroup > layoutelement > layoutelement
but i think that mightve been overkill

swift basin
#

Why a layout element inside another one?

steep warren
#

idk i was just trying stuff out and it worked lol
i unfortunately haven't had a chance to fiddle with it to narrow down what is necessary to make it work

spiral kernel
#

does anyone know why images in grid layout dont touch the edge of the content box?

swift basin
#

I got a scroll down setup where the viewport has the RectMask2D and it worked quite nicely, but as soon as I added a canvas group to the Entity Info container (cause I wanted to be able to make it alpha 0) it stopped working. Why is this? How can I fix it?

zealous verge
low pike
zealous verge
swift basin
#

Can I not use a sliced image that preserves its aspect ratio???

minor ocean
swift basin
#

Why.... would you remove the option of maintaining aspect ratio from a sliced image if I can later for it on with another component?

#

I don't get all these UI thingies....

minor ocean
#

For a sliced image, it wouldn't know what aspect ratio it should be, but the component specific for aspect ratios lets you specify what you want it to do.

steep warren
#

that's the point of slicing it

#

if you wanted to keep a specific ratio you could use the simple image mode

steep warren
swift basin
swift basin
#

So for the parent to streech I am using vertical layouts and make it expand to preferred height, but then the children's anchors get fucked up

steep warren
#

oh wait im dumb sorry

#

i skipped a few words in comprehension

#

I see what you mean

steep warren
#

and the children are arranged vertically

swift basin
#

Not all need to scale in height relative to witdh, no. But the parent MUST scale in size relative to it's children so I can place more parents down the line

steep warren
#

gotcha

swift basin
#

What I am trying to do is have something at the bottom of the j
hierarchy that scales its height based on width, and then pass that height up to the parents

#

With text sometimes does weird stuff, like when setting it to autosize and preffered width taking like twice the height it actually needs so I dunno

steep warren
#

jerarquy?

#

...hierarchy?

steep warren
#

@swift basin am i understanding this correctly:
you have 3 levels: outer container, inner container, images
outer container contains multiple inner containers, arranged vertically
inner container contains multiple images, arranged vertically
images scale by width of the inner container, some should preserve aspect and scale height according to width
inner container should scale in height to fit child images
outer container should scale in height to fit child inner containers

steep warren
storm kernel
spiral kernel
#

how would i allow the inventory module to expand vertically based on the gridcontainer?

honest saffron
storm kernel
honest saffron
vapid edge
#

How can I smoothly animate between a TMP_Text alignment (from alligned to left, to alligned to middle)?

#

currently the lack of animation is a bit jarring

#

currently I'm just setting it to no wrapping, lerping between start width to 0 width, switching alignment, and lerping back again, but I wouldn't call that an ideal solution

honest saffron
#

@storm kernel you gave me a thumbs up but forgot the screenshot? 😅

vapid edge
#

another question: is there a way to mask an object with another object, regardless of hierarchy? I have a background (not a parent of the text), that animates from scale 0 to 1, and I want the part of the text that is over the background to be a different color than the text that isn't over a background.

I have 2 copies of the text gameobject, overlaid on top of each other, so that the non-background text covers up the on-background text - and I want the background to cover up the non-background text, so that only the text underneath is visible

I might be going about it incorrectly, I'd appreciate some help!

storm kernel
#

@jakeman you gave me a thumbs up but

vapid edge
vapid edge
minor ocean
vapid edge
minor ocean
#

I don't think there will be a smooth way. When you switch justification, I assume TMP refreshes the whole mesh at that point, so it's just going to be instant.

scenic knot
#

Yo, I got a problem. Im trying to make a minimap and my raw image that has a material made from the renderTexture of the camera shows in the inspector, but once I lauch the game in the editor the raw image disapears. When I resize the editor manualy the raw image reapears in black. Does anyone know how to fix this?

swift basin
#

Hey, how can I modify a caret height on an input field???

#

Doesn't seem like something that shows in here, and while on the editor, it does not show as an element on hierarchy

azure flame
#

Go to material font and reset it to defaults, check font asset to have enough padding, might have to increase resolution to at least 512 when generating atlas.

vapid edge
#

when I have a GridLayoutGroup, how can I figure out which column a certain element is in?

#

as in, is there a built-in way, I can do it if I have to do the math myself (probably calculate X position for each column and find the closest one) but I'd rather not do it myself

#

I guess I don't need support for flexible column count grids... that makes things pretty easy since I have the child index. So nevermind I guess, unless there's a better option

tribal raft
#

I am trying to make the little dialogue trail( or however to describe it) like Paper Mario TTYD or Bug Fables to indicate who is talking in the dialogue bubble. I cannot find anything on that specific topic but that might be because what key words I am using. Does anyone know what it is called and/or resources on how to do it?

minor ocean
steep warren
#

apparently it's called a tail

jovial saffron
#

Hi, for a weird reason when i try to stretch my image to the max, it just doesnt

lyric rose
#

How to dock OnScreen Stick to the bottom left with offet and make it work properly. When it's docked to the center center it works OK, but once I dock it to the bottom left it bugs out and doesn't work:

low pike
lyric rose
#

I fixed it by creating an empty parent

#

Now it circles around the 0 offset of the empty parent that's positioned in the canvas.

worldly mountain
#

Excuse me, I'm making a minigame of forming words by clicking on hexagons with letters. But if I dont click on the center or I do it near the borders it will always detect that I'm clicking other letters... I think it is because of the scale of each hexagon, it will overlap a bit of the neighbour hex, but I don't want to separate them.

minor ocean
worldly mountain
#

I did, they have the raycast target

minor ocean
worldly mountain
#

yes

minor ocean
#

What is selected in the image? What is larger than the hex itself?

worldly mountain
#

the whole hex should be selected by clicking inside it

#

what happens is that if I click inside but a bit far from the letter it detects other hex

swift basin
#

Okay, I have a canvas on world space with order in layer 198 that contains an image. I want that image to be on top of a sprite renderer (no canvas), but no matter what order in layer it's, it does not render over the image. Why and how do I fix it?

swift basin
#

And why the heck we have 2 canvas components that are not the same????

#

I want to give my canvas an override sorting, but I can only do that if I make a child inside the default canvas and then give the child a canvas component

steep warren
steep warren
#

you have to translate the desired positions to screen space

#

are you working in 2d/orthogonal or 3d/perspective?

rough tree
#

i have this problem with my ui, when i open my mobile keyboard the entire ui moves up starting at the top of the keyb, i want my canvas or whatever to stay at the same position as it was before opening the keyboard.

covert flint
#

in content I have a content size fitter and a vertical layout grid. When I put a contentsize fitter on the FullMessage text then it messes up and shows me an error saying i have a layout grid. And when I put it in Message, it does expand the Message size, however, I want it to expand FullMessage vertically also to hold the Message.

covert flint
#

Also when i add more text, even though it is aligned to top, and fill width, it seems to be aligned center instead

minor ocean
#

In my experience, you're better off coding up a solution for this specific layout. It takes a ton of effort to get things set up with the layout elements and groups for something this complex. Even Unity recommends that you not use these elements, particularly internal to a scroll view.

covert flint
#

so i can still use the vertical layout, but code something that manages the height of Message and FullMessage?

#

what's the correct way of changing the height, because transform wants you to make a new variable before you can edit it

minor ocean
#

That sounds like it should work. Not sure what you mean about the height. Depending on your layout, you probably want to change the RectTransform.sizeDelta.

low pike
covert flint
#

aight yeah i figured it out somewhhat

#

what would the position be? cuz all i am finding is Transform.position

low pike
#

rectTransform.anchoredPosition

#

are you still trying to sort out the content size?

covert flint
#

the size is working now but it's not acting right for the anchored position

#

yeah even with hardcoded values, it doesn't want to act normally

#

it might be counted as code but i put it here for relevancy.

#

ok, so i ad to set the position to half the hight and it is working as designed now

covert flint
#

is it wise to have each window as their own canvas element?

#

like one for chat box, one for inventory and stuff?

ember quartz
#

HI,
I am on the scene view, I see its first view. But I want to change something on the next view, e.g. after pressing start the character selection view appears. And I want to change the size of the buttons there, etc. At the moment I can go through the hierarchy on the left and blindly change parameters without seeing this view. I can also press play, go to a given view and press pause. But then the changes made are deleted after stopping the game. How to do it correctly?

lime yarrow
frosty pewter
#

You either enable the element and edit in the scene view, disabling it afterwards; or you make a prefab out of the sub-element and open that, leaving it disabled in the scene view but enabled in the prefab.

ember quartz
#

how to enable it?

#

oh i need to select element on the left in hierarchy and then i need to check the checkbox in inspector, and now second menu is visible

ember quartz
#

because prefab is actually better, you don't have to remember to turn off the visibility of a given element after making changes.

frosty pewter
#

Having a prefab of that element would help you not modify the scene when you edit it

ember quartz
#

I see that it's better not to remove the prefab because the element doesn't return to its original state and is red 😄

tall shale
#

Hi, so i want to localize my game into multiple languages like japanaese and korean but their letters show up as square boxes in my TMP_TEXT how do i add these letters in my font ?

plucky salmon
#

hi,im trying to make a world space settings menu for my game but when i change canva (each settings section is a canva) the other section doesent appear,it works if i set the canvas as screen overlay so idk why it wont work on world space

plucky salmon
minor ocean
swift basin
#

I decided to make the containers of my dropdowns curved, but it leaves that shitty effect on the edges when hovering over the options. How can I mask the whole thing so it only shows inside the curved form?

signal tinsel
#

Is there a specific way to have a UI element and all its children recalculate its sizes etc at runtime?

My scenario is I have a tooltip I show over certain things, for example a weapon, but some weapons have more effects than others so it isnt always a set amount of content. Due to this I use a main container element with content size fitter, then within there I have other bits of the UI have content size fitters and layout groups so it can have any much content as needed and everything should fit accordingly.

It kinda works but when its shown with the runtime content added its a bit too wide and everything looks out of place. If I debug and manually go through each content size fitter and turn it off and back on it looks correct, so is there a way to have a node refresh all its childrens layouts?

signal tinsel
#

I tried that, it didnt seem to do anything

#

Let me just retry as I did alter a load of stuff at the time which I have reverted

#

Yeah didnt work, but I am only doing it on the root most container not the child elements, am I meant to go down the whole tree calling that?

#

Using LayoutRebuilder.ForceRebuildLayoutImmediate seemed to do better but it still isnt 100% correct

low pike
#

I can't remember how to use it properly, it's been ages since I've needed it.

#

I think you're best off waiting a frame or two, after setting the data, before calling it - make sure the layouts have had time to get whatever they need.

signal tinsel
#

😦 that adds in some complexity, but will look into it, thanks

minor ocean
#

By the time you add several layers of content size fitters and forced rebuilds, it is normally easier to just code up the sizing and do it yourself when you populate the tooltip. If you have a several items with flexibile sizes (like text box descriptions), this still can get tricky, but taking the time to make it straightforward and work how you expect it to is much less frustrating in the long run.

jovial saffron
#

Hi, i have an issue

i made up a set of buttons that are supossed to make the player revive, or quit the game, when you lose, but for a weird reason despite i added the programming to it, and works in testing, when i compile it doesn't work, why?

mortal robin
#

Also "doesn't work" is pretty vague, you'll have to be more specific about that

jovial saffron
mortal robin
#

Most likely there will be some error there

jovial saffron
#

ok

swift basin
lucid pawn
#

does anyone happen to know if there a fix for my issue:

i'm using a screen space canvas for my UI, everything works perfectly at 0,0,0 world co-ordinates, but the further i move from there the more and more off the clickzones become mismatched. if I place the camera at -9500, -9500 , -9500 (which is close to the 10,000 mark where unity starts warning about floating point precision) the clickzones are WAY off.

I know someone will likely point out the floating point thing IS the issue, but i don't understand in that case how most people use screen space canvases, you would barely be able to go past 1000 in any direction before the clickzones on your UI start looking visibly mismatched and half your buttons wont work when you hover-over the actual graphic.

I -can- mitigate this issue with my options menu and such by just using rendering masks and putting the camera at 0,0,0 but I haven't a clue how on earth the actual game UI is going to work when your near the corners of the map, nothing will line up with clickzones...

#

Amendment: I can obviously use screen space overlay which always works perfectly but that isn't an option here as im using post-processing effects such as bloom etc on the UI.

mortal robin
#

I know someone will likely point out the floating point thing IS the issue, but i don't understand in that case how most people use screen space canvases, you would barely be able to go past 1000 in any direction before the clickzones on your UI start looking visibly mismatched and half your buttons wont work when you hover-over the actual graphic.
Most games don't involve moving that far from the origin, and if they do they use a floating origin scheme.

lucid pawn
mortal robin
#

9000 is way too far

#

you start getting significant floating point precision issues usually around 2000

#

and I stick to 1000 for a good margin of error

lucid pawn
#

am i getting my scales mixed up here, because 1000 seems like a tiny area @mortal robin

#

or am i so zoomed out its seeming that way

#

i could chop up the map into sub-zones anyway

mortal robin
#

whether that's large or small really depends on the kind of game you're making

lucid pawn
#

yeah im looking for small city sized, so probably 10KM

#

so will probably need some sort of floating point thing then....ugh...wish they just had one implemented already.

reef night
#

guys, i am using text mesh pro and i imported a font, but its showing this random letters. the only working font is, Liberations Sans SDF which was preloaded. im using Unity 6

tame shell
#

If dynamic it will fill the texture as needed.

reef night
#

idk, someone in gdl channel suggested to drag and drop the ttf file in TextMeshPro folder and then create the font, and it worked. kinda weird

swift basin
#

Why does scaling one of the objects modify the layout, but multiple at the same time does not?

tame shell
#

Probably not set as dirty properly but you should avoid scale usage in layouts if possible

swift basin
#

I would want them to do like a pulse like animation without modifying the layout

tame shell
#

You can force a layout rebuild during the animation to make it work

#

I've done some complex layouts that require this for it to not break (e.g. scroll areas in scroll areas animating size)

frosty pewter
#

You don't. Outline just copies the rect 4 times and tints it

lime edge
#

Guys, is it possible to recreate the "red filter" used in the boss warning screen from Ikaruga?

#

I tried using camera post-processing with box volume, but the filter covers the whole dang screen rather than only part of it

proud sandal
lime edge
#

This is the kind of filter I want, but only applied on areas within that image

steep warren
#

could have it on a layer under the ui but above the rest of the level

lime edge
steep warren
#

explain what exactly?

#

layers?

lime edge
#

I have a main camera with several other cameras stacked, and I did position the post-processing layer between the ui and gameplay cameras like you asked (unless you meant ordering it in reverse)

steep warren
lime edge
#

@steep warren Where do I start with the sorting layers method?

steep warren
#

wait hold on i think i misunderstood something

steep warren
lime edge
steep warren
#

im confused

#

oh i see

#

looks like it's multiplying the color in instead of adding, right

steep warren
#

hmm seems like you might need shaders for that

#

how'd you achieve it for the second image?

lime edge
#

I simply added the following effects in the box volume

mossy spruce
#

guys i cant see the ItemUI because he is a child of the InventoryFrame and i have to make it the child of the InventoryFrame but i want to be able to see the child also ItemUI. How can i do thath?

steep warren
steep warren
mossy spruce
steep warren
mossy spruce
#

and i cant set the sorting layer there is none

lime edge
steep warren
#

kinda weird you'd have to add an entire canvas though

mossy spruce
steep warren
mossy spruce
mossy spruce
steep warren
#

what object is it on?

#

is it on Inventory by any change

mossy spruce
#

when i disabled the settings frame now i can see lol

#

mb

tidal apex
#

so i try follow a guide that teach beginner how to make game, and in guide said i need to change the anchor presets, but everytime i try to click the desired anchor presets its back to this anchor presets(top left). after try to understand a bit and experiment i think its because the horizontal layout group script that cause this, but the guide doesn't say anything about this, can anyone help me on this

devout badger
#

Where do you think is the best placement for my game title here?

steep warren
#

definitely not 3, that places it quite low in terms of graphical hierarchy

devout badger
#

I'm leaning toward 2 mostly

regal epoch
#

Image exported from figma / In Game

Why does it look pixelated in game?

mortal robin
sage lagoon
#

howdy, having issues on my first game with canavases and things 'moving' The top left text and some other stuff moves, I finally figured out what triggers it, if i accidently drag out the 'game' window to be not a 'tab' but a seperate window, and then fix that by going to window > layout > default, It moves the cavas to this weird position and offsets everything

mortal robin
#

it's a sign that you haven't anchored your UI elements properly

sage lagoon
#

Yeah its my first time so i kinda just threw them in lmao

#

thanks ill check that out

mortal robin
#

you also will want to explore the different canvas scaler modes

#

the most common mode to use is Scale with Screen Size

sage lagoon
#

Ah i see

#

Okay i'm gonna target 1920x1080 now i'll look into the anchors

#

thanks again

mortal robin
# sage lagoon thanks again

If you look at the top of the Game Window there's a dropdown from which you can control the resolution and aspect ratio of the game window.

Make sure to test it with different aspect ratios to make sure it always looks good

sage lagoon
#

Okay so I set up the top left one and changed the aspect ratio and it worked!

#

Shows me I need to fix all the other elements lol

#

Thanks again

#

I anchored to top left idk if it matters much

regal epoch
regal epoch
chrome kettle
chrome kettle
# regal epoch

Filter mode is fixed there but mip map generation is still disabled
Enable it and apply, and observe the result
Compare bilinear and trilinear as well

regal epoch
chrome kettle
#

Unity uses mip maps and filtering for smoothing textures when they are viewed at non-native scales, so it definitely should work
Assuming something is not overriding the effect which shaders can do
Technically also a lower render scale with nearest neighbour filtering can cause the effect you're seeing but it's very unlikely to set that by accident

#

Bilinear and trilinear should be both smooth, as long as mip map generation is enabled

#

If nothing changes, it's possible you're editing a wrong texture's import settings

regal epoch
#

I will give it a try again later

sage lagoon
#

Ignore the chaos that is my workspace, Does anyone have any experience using the 'Starter Assets - FirstPerson ' and pausing? I can't seem to freeze movement when setting time to 0, (creating a very basic pause menu)

#

(Also had no clue where to put this in terms of channels, user inferface makes sense I guesas)

#

I could cheesily cover the screen, or disable the camera, but if you unpause you will be looking in a completely different spot. So ideally I dont want to do that

mortal robin
# sage lagoon Ignore the chaos that is my workspace, Does anyone have any experience using the...

I don't know it in particular but almost certainly because the mouse look code doesn't use Time.deltaTime at all it's not affected by setting the timescale to 0. This is a very typical pitfall for beginners.

The way to fix this is either:

  • Disable that look script when you pause
  • Have the look script check if the game is paused before it does any looking. You would do this by having some kind of singleton script that handles pausing the game and has a bool property your other scripts can read that tells them whether the game is paused or not.

For the second option you could also expose an event that other scripts can listen to and handle enabling/disabling them with the event.

#

and no this isn't really a ui question

sage lagoon
#

Good call i can just disable this

#

That's attached to the player capsule hmm

#

Need to disable a script from a different script, but they are on different objects

sage lagoon
#

moving to code beginner

orchid vale
#

how would I do something like this in terms of the LED Video ring?

#

Cause currently I only seemingly understand how to make it work on a flat object, but I am interested in replicating a similar map setup to something that involves curved videos/motion graphics like this

proud sandal
#

assuming the latter: you can use a render texture as the baseMap on any material, then assuming the motion graphics are a video you simply draw the video to that render texture. if you also make the motion graphics, realtime in unity, you make a camera that renders to that render texture -> you would also make a scene for the motion graphics and that mg-camera which render layers invisible to the main camera.

#

at the end of the day its a regular portal effect

mild pilot
#

Hi. I dont remember but at some point all my UIs are not visible in the scene viewport. The outline when turned to "Shaded wireframe" is still there tho ?

#

Checked Layer visible, checked the canvas renderer in the hierarchy, etc

stoic hull
#

all actions are set correctly in EventSystem's component

stoic hull
#

well, i simply used default asset instead of mine
so the problem is solved

swift basin
#

I want the slider to be capped at 10% min, and I adjusted the hanlder to do that, but I am unable to do that with the fill area. How could I do that?

swift basin
#

Like manually by pixel?

steep warren
#

or its anchors, actually

#

would be easier to just say anchor min x 0.1

swift basin
#

I did that but them it just let's the left part "unfilled"

steep warren
#

that's part of the background, not the fill area

swift basin
#

I did this at the fill area

#

And then added a -X to the Fill, but seems not very accurate tho

steep warren
#

i might be misunderstanding what you want

#

you don't want to offset anything visually, just restrict how far to the left the slider can be dragged?

swift basin
#

Both

steep warren
#

im not sure you can do it cleanly here

#

my first thought is just, change the min value so it's actually the minimum you want

swift basin
#

It just makes the 0 visual position equal to the min value, does not affect the layout

steep warren
#

yeah that's what im referring to

#

the other option would be to restrict it to 10% with code i guess?

lilac relic
#

I'm trying to add an outline to the textmeshpro text in my game, but the outline part of the material seems to be completely broken. I've been switching through nearly all the different shaders to see if that's the issue but to no avail. Please tell me what the heck I'm doing wrong?

ember wharf
#

how can i fix this?

steep warren
#

fix what?

ember wharf
# steep warren fix what?

oh sorry, the game clips out from the view and i have these blue borders from the side that shouldnt be there

steep warren
#

those blue borders seem to be from the camera background

#

basically the window is wider than the stuff you actually have

ember wharf
#

ooh

steep warren
#

could you be more specific on that first point? im not sure what exactly you mean

ember wharf
#

this is what it looks like from the game view in the editor

steep warren
#

is your window perhaps longer than the screen?

#

like try moving it up

#

that might help get a better idea of the issue

#

maybe you haven't set proper anchors or stretching?

ember wharf
#

these are my player settings and canvas values btw

#

and the main cam

ember wharf
#

ok i got to fixed it 😆

idle pond
#

Hey all,
I have an issue about button release callback. On mobile sometimes and randomly, button release is not called. But this issue doesn't happen on editor. Any idea ?
btw, I'm using new input system.

#

Also I use these functions on that button too. Not sure if it is because of them.

        public void OnPointerUp(PointerEventData data)
        {
            SendValueToControl(0.0f);
        }

        public void OnPointerDown(PointerEventData data)
        {
            SendValueToControl(1.0f);
        }
#

Because I added a print to OnClick event on the button and sometimes after releasing button it doesn't call.

mortal robin
idle pond
idle pond
#

I don't know why but when button is Right Mouse Button OnPointerUp and OnPointerDown are called twice. Any idea ?

low pike
#

Got the component in scene twice

swift basin
#

Hey, if I make something 1px high or width, it sometimes doesn't show at all

#

I am guessing cause it's scaling to the actual resolution and cannot show that pixel, but how can I make it so it ALWAYS renders that pixel?

#

Like I want something to be really thin but make sure it always shows at least 1 pixel

winged onyx
#

Hello, im trying to make a 3d animated object into canvas

#

This asset to be specific

#

I want to create this good affect of lightning on both sides of a screen when card is played

winged onyx
#

So how do i make a 3d object part of a canvas?

proud sandal
jagged monolith
#

This should be in the pinned message 😄

mortal robin
winged onyx
dark lance
#

Hi, guys. I have two canvases. The one is main and render in screen mode with camera, another one is in world space. The one attached to camera has no buttons, and another does. But the camera canvas somehow overlaps the world space one and I can't click on the buttons on it. How do I fix it?

P. S: Problem solved, I forgot to place it higher in the sort layer and messed around for an hour🥲

low pike
boreal ferry
#

What causes these transparent squares behind my font, and what can i do to remove them?

maiden turret
#

Hi all, I have a tiny problem with my Color Lerping functionality. I have a singleton color tween class, which contains some lerp coroutines that other scripts can use to change the color of a target graphic from a value to another.

The problem arises when I disable the game objects that are having their Image's color changed mid lerp using the class, the color gets stuck on a mid-color lerp value and stays that way.

By disabling a game object, I mean changing menus in game, like disabling the game menu and enabling the pause menu.

here is the full scenario:

I have GameObject A which has the singleton color lerping class component

I have GameObject B, it has an Image. it also has a script that calls the coroutines from A and uses it to change the color of its Image

I change the color of the Image of A using its own script and using my color tween class from red to blue

I disable GameObject A mid-lerp

The Coroutine that is changing the color of A doesnt continue changing its color, when i re-enable A, the color is stuck between red and blue as expected.

To my understanding by disabling the game object all coroutines get halted and stop processing. How can I catch this and force change the color of my graphic to its target value when its coroutine gets halted ? Why does this happen though ? we are still able to change any Graphic's color even if the parent is disabled from code.

I can already fix this by adding an OnEnable to any script that might use the lerp functionality and revert it back to its own color, but that is not very clean. Wanted to see if there was any way to handle this from the Color Tween class itself.

#

Here is a sample of the Tween class's IEnumators

` public IEnumerator LerpColor(Graphic graphic, Color start, Color end, float duration)
{
if (graphic == null) yield break;

    float elapsed = 0f;
    while (elapsed < duration)
    {
        graphic.color = Color.Lerp(start, end, elapsed / duration);
        elapsed += Time.deltaTime;
        yield return null;
    }
        graphic.color = end;
}`
mortal robin
#

How can I catch this and force change the color of my graphic to its target value when its coroutine gets halted
You can do this by writing code that does that at the same time that you disable the object

#

One option is to just run all of the coroutines on the singleton instead of on those individual objects that you plan to deactivate

#

another option is to wrap the SetActive(false) call inside a helper method that also handles the color stuff properly.

#

You need to be very aware of which object the coroutine is running on. This is determined by which object you called StartCoroutine on.

maiden turret
celest breach
#

Does unity have some equivalent of unreal's scale box? Googling doesn't mention anything relevant (ping me if you reply)

spare dirge
#

Hey, is there an equivalent to "Vertical Box" from Unreal but in Unity please ? 🙂

low pike
#

You two might want to explain what those two things in Unreal are and what they do.

spare dirge
wild pebble
low pike
#

Vertical Layout Group
Horizontal Layout Group
And Layout Element, for cases where you want to hve a bit more control over the size of things beyond the layout groups

spare dirge
low pike
spare dirge
#

alright 🙂

sullen scaffold
#

Trying to make a progress bar however when i change my image type to fill it loses its aspect ratio and i cant find a fix

mortal robin
sullen scaffold
mortal robin
sullen scaffold
low pike
sullen scaffold
#

No ill boot up my pc and show u give me 5 mins

vagrant patio
#

Ok

sullen scaffold
#

thats with preserve aspect ticked

#

and then i cant change the size of it

low pike
#

That sprite needs to be 9-sliced

sullen scaffold
low pike
#

Google -> Unity how to 9 slice sprite

sullen scaffold
#

oki

#

all fixed

#

thanks guys

meager stream
#

hi someone know why i got this render with my pixel art sprite like i have some pixel than disapear (that made that only in the game renderer)

honest saffron
meager stream
#

im french sry

#

i will chech this ty

minor ocean
#

Generate Mip Maps -> No

rocky walrus
#

hi guys, after working on this UI, it just hit me that i have to add a description box...

#

where could i fit that in? i can make it scrollable

#

as you can guess the white big rectangular shape is the level logo, in the future i want to make so that there are more than 1 level photo, so i probably will add buttons on its left and right side to scroll trough

dusk pasture
#

I have no knowledge about this program one bit so forgive me for asking anything that seems trivial. I made all the squares buttons and my intent is to make it to where when play, exit, or options is highlighted they will enlarge and bring all the other squares into a smaller position. im a 2d animator w no code experience at all, so i was just under the impression i can parent the other button animations to play and make them shrink into the positions I put em in, so please lmk if this is just not possible lol. sorry if this doesnt make sense,,

celest breach
#

And I'm just going to assume that unity doesn't have an "out of the box" equivalent for this

low pike
celest breach
#

no it doesn't, those just forcefully stretch the content instead of maintaining the content element's aspect ratio (though unreal's scale box has settings to stretch like this but this isn't what I want)

low pike
#

Yes they do.
You need to tick the “keep aspect ratio” flag on the images components.

celest breach
#

where specifically did I mention images?

low pike
#

That’s the only thing that gets stretched. Nothing else that I can think of would be

celest breach
#

ended up asking chatgpt and it gave me a working solution, should have done it from the start

low pike
#

Which was what

twilit abyss
#

stackoverflow moment

pulsar mauve
#

Why is this pure black UI image lighting up my scene? No lights in the scene. Using HDRP if that matters.

wild pebble
#

If you don't want to disable that, you can consider changing the Filtering option of it, it seems to do pretty much what you want to do:

Set the lower and upper percentages of the histogram that find a stable average luminance. Values outside of this range will be discarded and won't contribute to the average luminance.

pulsar mauve
#

Thanks for the details!

severe apex
#

hey hey :) i am currently working on a school project and- im way in over my head. I need help :,D
I trying to make a funktional main menu. So basically: 6 buttons that go where they need to go, and a little screen before that just says "click to continue"
For some reason my camera doesnt show anything?? Like idk if its the placement, size or what- its making me crazy
and i don't even know how to start with the buttons- If anyone has a little time to spare i would be incredibly grateful

jagged monolith
static quail
#

i'll tip $20 to the person that can help me set up auto-layout in unity ui

static quail
#

you don't do UI or you don't help? why are you gatekeeping? if you're not interested, you're not obligated to reply

steep warren
#

we can't help if we don't know what you need help with

static quail
#

i said i will tip

#

if anyone is interested - please DM me

minor ocean
severe apex
#

So ive followed the tutorial so far but ive ran into this issue? Like when i press the button its not taking me where it should? Where and what are the build settings-

steep warren
minor ocean
severe apex
#

it works it works it works YIIPPPII

minor ocean
#

The messages from the engine in the console are generally pretty helpful. Just have to take a few beats and read what they're telling you.

static quail
#

Chris do you have nothing better to do than gatekeep?

static quail
minor ocean
# static quail

Is the number of 'img' per box going to vary? Do you want them to just be left and right all the time, or fill in the middle too?

rocky walrus
#

im so sorry to ask this but is this AI generated 😭 i was looking at it and the Report button looks so messed up and the text font feels weird idk why, and the bar, author name is just weird 😭

#

but yeah description between the icon and subscribe really is a good idea, thanks will actually do that

steep warren
severe apex
#

okay so my main menu is functional and all now- but- my character in the middle is like- see through? i played around with the hierarchy but nothing seems to work

steep warren
#

it looks like the pink thing is in front of the character

severe apex
#

yeah- i thought the same but no matter where i move her in the hierarchy she just gets a little more see through

#

this is the settings? its if that helps?

steep warren
#

try hiding the pink effect in the hierarchy

#

or also the background

rocky walrus
#

on color, you can see the transparency bar is like 40%

#

that white/black line is transparency, called Alpha value

severe apex
rocky walrus
severe apex
#

we got it 👍 thanks guys fklsdjflskadf

steep warren
#

nice

rocky walrus
severe apex
rocky walrus
severe apex
#

ohhh :O u makin one? can i check it out somewhere?

rocky walrus
livid ore
rocky walrus
livid ore
rocky walrus
#

Posting unverified AI-generated responses or failing to mark AI-generated content as such.

#

it is allowed just mark them ig

livid ore
#

According to the conduct at section "Content" at 5th statement "• Don’t post unverified AI-generated responses in questions or answers; check for accuracy, and state what’s AI-generated." so it is allowed when it is revised to be correct.

rocky walrus
rocky walrus
opaque brook
#

I have a prefab that has different UI elements inside for a script, I do not understand why it's doing this. It just doesn't show up.
I want them to be scaled to the screen and be placed on a list but the damned thing refuses to work as it should. I did several tests and tweaks before and it's just... invisible

mortal robin
#

Also one weird thing here is why do the prefabs have their own canvas?

opaque brook
#

I expect to see an icon, a name, a cost and a buy button constrained within the scrollview area.

#

I do not know, I figured they may need canvas to render, I have no idea how text mesh pro works and I'm just starting out

opaque brook
#

Because the prefab I used to put in the 'Upgrade Item Prefab' has a canvas maybe?

mortal robin
#

Anyway I don't actually see any renderable components in your screenshot

mortal robin
opaque brook
mortal robin
#

it shouldn't have those

opaque brook
#

so just a transform?

mortal robin
#

those first three components can be removed

#

Just the Layout Element

#

and anything below it

#

but you also haven't shown the actual graphics on this prefab

opaque brook
#

These are the graphics

#

Image, button and 2 texts

mortal robin
#

the inspector would be good

#

especially for the text

opaque brook
#

does the prfab have to be in the hierarchy?

mortal robin
#

What do you mean

#

The prefab itself lives in the project window (assets folder)

#

you do not need an instance of the prefab in the scene during edit time

#

you can instantiate it at runtime

#

but you can put instances in at edit time to figure out your layout/graphical issue here

opaque brook
#

yeah thats why I asked. It shows up fine in the scene

#

I can't use 'layout' element without the rect transform

mortal robin
#

you need the RectTTransform, of course

mortal robin
opaque brook
#
using UnityEngine;
using TMPro;
using UnityEngine.UI;

public class ShopManager : MonoBehaviour
{
    public static ShopManager Instance;

    [System.Serializable]
    public class UpgradeItem
    {
        public string itemName;
        public Sprite icon;
        public float passiveBoost;
        public float tapBoost;
        public float cost;
    }

    [Header("Shop Settings")]
    public List<UpgradeItem> upgradeItems;
    public GameObject shopPanel;
    public GameObject upgradeItemPrefab;
    public Transform contentParent;


    private void Start()
    {
        PopulateShop();
        //shopPanel.SetActive(false);
    }
mortal robin
#

I don't see any instantiation here 🤔

opaque brook
#

fuck Im trying to paste it but its too long

mortal robin
#

Ok pleasantly surprised to see you used the correct version of Instantiate 🤔 that should work fine

opaque brook
#
    {
        if (QiManager.Instance.totalQi >= item.cost)
        {
            QiManager.Instance.totalQi -= item.cost;
            QiManager.Instance.qiPerSecond += item.passiveBoost;
            QiManager.Instance.qiPerTap += item.tapBoost;
            Debug.Log($"Purchased: {item.itemName}");
        }
        else
        {
            Debug.Log("Not enough Qi");
        }
    }
    private void Awake()
    {
        if (Instance == null)
            Instance = this;
        else
            Destroy(gameObject);
    }
    private Transform FindDeepChild(Transform parent, string name)
    {
        foreach (Transform child in parent)
        {
            if (child.name == name)
                return child;
            var result = FindDeepChild(child, name);
            if (result != null)
                return result;
        }
        return null;
    }
}
#

ok I think is it

mortal robin
#

I don't see any issue here. I would recommend simply putting a script on the root object of the prefab and giving it a public void Init(ItemDescription item) method to set all that stuff though

#

instead of this FindDeepChild stuff

#

just for the sake of encapsulation (and performance)

opaque brook
#

also its not showing up after I removed what you suggested, lol

mortal robin
#

so at least here it makes sense it's not rendering

opaque brook
#

Well the first time around the canvas parent was part of the prefab but I named the canvas the appropriate name

#

and placed that into the script

mortal robin
#

I expect it to live under this contentParent, right?

#

drag the prefab under there (from the project window) and see

#

it should render fine

opaque brook
#

🦑 It's not

#

Might be better to start over atp

mortal robin
opaque brook
mortal robin
#

if you disable the mask for a moment does that change anything?

opaque brook
#

yeah the shit appears

mortal robin
#

ok so - we do want the mask, because the scrollrect situation won't work properly without it.

#

But at least we know it's some issue with the mask now - I think maybe something in the hierarchy between contentParent and the Canvas has some kind of issue with sizing

opaque brook
#

Well, even with the mask disabled, after removing the prefab from the scene and running the script it's still not showing up

#

Edit: it shows up in the wrong place

mortal robin
#

ok so you have at least two issues

#

one is a layout issue - your UI may not be properly anchored

#

Actually they're both probably layout issues 😛

opaque brook
#

when I watch game dev videos I dont see anybody crying about this 😢

#

Doesn't help I have no idea how text mesh pro works... I miss the old text

mortal robin
#

Double check that you're using TextMeshPro - UI as well

#

and not the regular TextMeshPro

opaque brook
#

this is how I created everythig

#

I'll go back to the drawing board with a new project. Thank you for your time, I'll do better and come crying when I encounter this error again haha

sturdy stag
#

Hello, I am really curious why this doesnt work all of a sudden. I have a panel that I want to set active and unactive whenever i press a button. This used to work in earlier Unity versions, but not sure why it doesnt work now that I am using unity 6?

mortal robin
#

it will not toggle

#

and never would have.

#

to toggle it you would need a function like this:

public void ToggleActive() {
  gameObject.SetActive(!gameObject.activeSelf);
}```
sturdy stag
mortal robin
#

that will never to anything other than making the object NOT active.

sturdy stag
#

Ah okay, thanks for showing me!

signal tinsel
#

Is there any performant/easier way to get a couple of px drop shadow on textmesh pro text outside of just duplicating the text and putting it slightly underneath with a black color?

I know textmesh has outline and lighting effects but for more pixel fonts it just looks bad and I can't find any other avenue to make it look legible (using unity 6)

minor ocean
opaque brook
#

Uh... I broke it?

rocky walrus
#

How can i make so that i can click on buttons outside of the scrollview?

#

because i did set them so they are not masked, but raycast doesnt work on them

mortal robin
#

and when you say "raycast" - what do you mean precisely

rocky walrus
#

i am not able to click them

rocky walrus
#

=> raycast is not working

mortal robin
rocky walrus
mortal robin
#

And what do you mean by "raycast is not working"? Like you tried to write raycast in your code?

rocky walrus
#

and also the arrows

rocky walrus
#

im just saying that, it is as if it doesnt exist

mortal robin
#

which part is the scroll view?

rocky walrus
mortal robin
#

Ok well - can you show how the hierarchy is arranged?

rocky walrus
#

here

#

dont worry, i can click them if i put them out of the scroll view, and i can click on levelAuthorImageItem in AND outside of the scroll view if needed

#

everything is working as fine based on the buttons, its just that i cant click them if outside

#

if i try to move them so that they are inside of the scrollview then yeah - i can click them

mortal robin
#

Why is that popup modal in the scroll view?

#

That seems weird

rocky walrus
mortal robin
#

yes

rocky walrus
#

when i scroll..

#

this is a well known issue in UI

mortal robin
#

there's probably a better less-raycast-effed way to do that

rocky walrus
#

im just wondering if there is a better way

rocky walrus
mortal robin
#

probably just make a small script that makes it follow the thing

#

and have it not be a child of the scrollview

rocky walrus
rocky walrus
outer belfry
#

Hello i cant figure out why my ui_inventory don't display as i expect but the munitions and health does:

mortal robin