#πŸ“²β”ƒui-ux

1 messages Β· Page 59 of 1

elfin kestrel
#

Outline Thickness: 0

atomic tapir
#

Why is this text hidden behind the image? Any possible solutions?

I went off from 2d to 3d to check the other side of the image, image is still hidden by the image.

zealous remnant
#

Hello. I want to ask why my button UI cannot clicked although that was interactable? Wait I'll give a screenshoots

#

please help :((

jagged monolith
#

Do you have an event system in your scene that I'm not seeing @zealous remnant

zealous remnant
#

Ahh, I forgot to add that, because I'm just copying that canvas from another scene. Anyway thanks for correction

chilly lion
#

So each object has a Canvas attached to it for using it

#

Is this okay?

#

or is this a performance hog?

#

and what is recommended way to do this?

low pike
#

using multiple canvases is good, and should be done πŸ‘

stone pollen
#

why is my slider not moving in the game?

mortal robin
#

for example whats in the SetVolume method that you have hooked up?

stone pollen
# mortal robin Do you have code that sets the slider value in a script?

yes but this is only one time and can't be the issue because I still can move it in the insprector without that a code would reset the value. it is a problem with the UI interaction somehow, I made a new slider and connected the scripts I have and everything works just fine, but why was it doing this troubles before?

mortal robin
stone pollen
#

why you give my code the fault?
I said in the inspector like video position 0:16

#

I did'nt changed anything of tghe code but after I created a complete new UI slider and put my same scripts into it. the problem was gone

#

I made the sliders new but drag and drop the same scripts inside

#

@mortal robin

mortal robin
#

You have something in that original scene causing it not to work, probably your code. It might not be the OnvalueChanged code. Could be any script in your scene referencing that slider

stone pollen
mortal robin
#

Like I said it's not necessarily that exact code

#

Could be any script doing it. Now that you re-created the sliders you've broken whatever reference that other code had to your slider

stone pollen
#

but why is it working now without changing the code?

mortal robin
#

Now that you re-created the sliders you've broken whatever reference that other code had to your slider

arctic copper
#

Please does anyone know why my game over Ui, works on one level, but not in any other levels

mortal robin
arctic copper
#

the code dosent really control much, other than setting the each text labels, and also showing the game over ui when the player dies

#

but the problem is like as if the mouse never get detected on the other levels when i put it over the button

mortal robin
arctic copper
#

wow, thank you so much, i didn't realize it was such a simple issue

teal prawn
#

why do classic Text even exists why even unity themselves claim that text mesh pro is better?

mortal robin
#

They don't want to break projects that are using those components

#

Imagine you made a whole game with thousands of Text objects, and you go to update Unity and it's removed. Now your whole game is broken

teal prawn
#

well

#

it's a messy solution but ok

grave meteor
#

can't add ui at all?

#

using hdrp

grave meteor
#

ayo

#

pls

mortal robin
grave meteor
#

sorry forgot to say i fixed

#

just had to restart editor

grave meteor
#

how to fill border. i have alpha, but how do i apply it?

prime nacelle
#

any reason why an image would show in game view but not in the build?

mortal robin
prime nacelle
#

the fist panel is active and there is a button that sets it's active to false but on opening the project I don't wee it in the build

I do see it when I play the scene though

lavish stump
#

Does dropdowns work horizontally? Never mind, they do.

dim prawn
#

is there a way to sync 2 sliders across different scenes?

#

for example, like an audio volume slider

mortal robin
#

That's not really a UI question per se

#

just a "how do I transfer data across scenes" question

#

I feel that a ScriptableObject for game settings, referenced from a Monobehaviour in both scenes, would be a good solution, backed by PlayerPrefs.

#

You might also look into a dedicated menu scene that is additively loaded and reused across both scenes

coral echo
#

Hello. I have app with UI which is build into window form. I have problem with changing the size of the window. The UI changes and goes over the panels etc ... I used pivot but didn't help maybe I use bad pivots ... :/ Do you know how make it effective?

dawn rampart
#

I have a couple of problems I need to solve

#

#1 I have set up a scrollview with a vertical scroll bar, the content, viewport, and scrollbar are linked to it, and have identical settings to another scrollview I have set up, yet (unlike the other one) this one won't scroll when I alter the position of the scrollbar in the editor. Is there a common mistake made when setting these up that I might have made? I'm not sure what else to do to solve it.

#

#2 I have a horizontal scrollview to hold an unpredictable number of items. I want the far right edge of its contents to fade to translucent to indicate there is more without simply being clipped by the edge of the screen or scrollview (which looks ugly). Presumably I need to do this with a mask of some kind with a semi-transparent gradient at the end of it. Scrollview's have one by default which would be great, except that I can't know the size of the scrollview in advance because it will need to adjust to the different screen widths of different devices - this would mean that the mask is stretched and the gradient would be stretched too. I'm also unsure if you can do a masking gradient (vs just a shape)? What structure of layout do I need to get that masking gradient working for this scrollview?

naive trellis
#

I can't drag textMeshPro into this prefab i can only drag it when the object is not a prefab how to fix that please

frosty pewter
fast valve
#

Hello! I have a specific issue when using LeanTween to animate UI. If anyone uses LeanTween, please help out!

#

In general, unless I use "ignoreTimeScale", my UI animations bug out and either stop completely or start looping in a random interval. For example, a blinking alpha that was supposed to go from 1 to 0 starts going from 0.780081237 to 0.709971. In other cases, the animation seems to not happen... That is, unless I have something else using the Update function in the scene, which is when the animation seems to work correctly. It feels to me like LeanTween is waiting for other things to update in order to update itself

#

Did anyone ever see this?

woeful canopy
#

Hi. What is the best way to hide windows in window management?
Is it enough to set the canvas group alpha to 0? Or what components need to be disabled?

low pike
#

setting the alpha to 0 doesn't stop

  • the transforms updating when something else moves
  • interactions with the elements under that group
#

Toggle the gameobject with the canvas group on

boreal moat
#

I want to anchor some UI panels to physical anchor points in a 3d world, but I don't want them to overlap with eachother so I can't use a World Space canvas. So I guess I would have to manually place the panels through code, to display in a Camera Screen Space canvas, but does anyone have any advice on how to actually keep the panels separated but as close to their anchor positions as possible? Can I use 2D physics for this somehow?

rotund igloo
#

Hey, I have a question about TMP, I have imported a monospace font yet the rendered text don't seem to handle the white spaces as equal width as all other characters, how do I fix this? This becomes a issue when multiple white spaces are added in succession

grave meteor
#

how do i only fill up border space? i have an alpha texture if needed.

grave meteor
rotund igloo
jagged monolith
grave meteor
#

how do i use this

#

@jagged monolith sorry for ping but i don't have much time rn

jagged monolith
#

I can't tell you exactly where it needs to be in your case. But take a look at how it's set up on the default UI slider

grave meteor
#

aight

#

also, watching the official uninty tutorial on this, but it won't work for me since the image is grow on the y

#

and this looks weird

jagged monolith
#

You don't want to scale it but change the fill amount

grave meteor
#

so to change the alpha progressively on y?

jagged monolith
#

If you set the image type to filled, you get a slider

grave meteor
#

ok thx

#

perfect thx

somber jasper
#

Hello guys, so I have one question. How can I like get a debug.log message when someone pressed the determined "cancel" button on UI? Because I set up a join menu and I want the player to reset his actions by simply pressing "b" on controller or any button. I dont really seem to find anything.. im kinda new to this. Thanks for any help. Im using this in the screenshot

mortal robin
honest belfry
#

Ok, so nesting canvases is really bad for performance because it requires rebatching all nested canvases when something changes, however, by not nesting canvases, each canvas needs its own graphic raycaster which is also really bad for performance.... is there a way to get around this? or Do you just have to find a balance between the number of canvases for rebatching vs raycasters?

digital kayak
honest belfry
digital kayak
honest belfry
#

Pretty much all the objects are interactable, so I might have to rework something

digital kayak
low pike
#

@halcyon heron seems more like a UI thing, let's move here

halcyon heron
#

Nice thanks πŸ™‚

#

Hmmm so I had it set to scale with screen size

#

Which seem to work well with UI elements, Although I need to use a sprite

low pike
#

image components use sprites

halcyon heron
#

So that I can animate it (it's my character speaking in dialogue)

low pike
#

if you mean Sprite Renderer -> that's not UI

halcyon heron
#

Sorry I'm a bit confused on terminology

halcyon heron
#

It's actually a PSD file*

low pike
#

like a pokemon dialogue box thing when you interect with something

halcyon heron
#

Yeah something like that

low pike
#

I don't know about the animating bit of it, but to get the size of things so you know how big to scale the PSD canvas.. setting the CanvasScalar to a constant pixel size (eg: 1920x1080) putting an image that's 64x64 on there will always been 64x64

halcyon heron
#

The problem is, I drop by like 15 FPS right now cos I exported it too large (from Illustrator, so vectorial)

low pike
#

you'll want your image sizes to be err... divisible by 2 IIRC

halcyon heron
#

I'm trying to wrap my head around the problem so I can explain it thoroughly rather than bits by bits ^^

#

So right now, my player's scale (the whole PSD object) is scaled to 25 so that it's size is the one I want IG

#

I'm trying to reverse the process : get the current scale of the object, so that I can export a smaller version out of Illustrator

#

Is that clear?

#

Like right now, I can tell that dividing the size by 3 wouldn't change much the end result, cos the current image is way too high definition. I'd like to actually calculate that factor

#

@low pike Just @ ing you cos it took me times to work it out :p

halcyon heron
#

Yup

low pike
#

sooooo.. what might work is

#

Create a second UI, and set the canvas scalar on that to a constant pixel size (eg: 1920x1080). Then drag the player from it's current canvas to be a child of this new canvas. The scale of it will change.. that should be the size you can use in other programs

halcyon heron
#

I already have a canvas scaler set to scale with screen size (1920*1080) on the canvas I'm using

low pike
#

ah

#

so 25 is the value then

halcyon heron
#

Holy crap did I really made it 25 times too large? Lmaooo

low pike
#

Difficult to say without being able to see it

halcyon heron
#

It seems smaller than that, but then again I didnt use AA so this might be it

#

I'll give it a go, thanks for the help πŸ™‚

low pike
#

np πŸ™‚

halcyon heron
#

25 times too large would explain a drop in 15 FPS tho xD

mortal robin
#

I appreciate that now in 2021.2, the non-TMP UI components are considered "legacy"!

halcyon heron
# low pike np πŸ™‚

It's definitely not 25 :p a rough measurement on paint tells me it should be 500 pixel in height, I just have no idea how to determine that number another way =/

low pike
#

You're looking at a RectTransform width/ height in Unity yeah?

#

scale should be 1,1,1 for UI always.. and then ^ that gives you the values you want

honest belfry
#

Anyone know how to implement occlusion culling on 2d Images ?

#

Or can give some tips? I have a bunch of Images off camera that are killing render times, but activating/deactivating the objects is super slow... is there perhaps some alternative that I don't know about (occlusion culling)?

mortal robin
#

off camera would be Frustum culling, not occlusion

#

Unity does Frustum culling by default for 3d objects, but IDK how it deals with UI

honest belfry
mortal robin
honest belfry
# mortal robin What if you use a canvas group and set alpha to 0? Does that help? Or put that ...

Both good ideas... unfortunately they will both require major changes to the architecture... The offscreen images are parented to onscreen images... so theres not an easy way to separate the two in the current state of the game. Yes I can separate them, but i'd like to avoid that if possible.
Basically each object represents a Die. The Die has a single face view (left) which will show the currently rolled face and a multiface view (right) where you can see all faces of the die and apply upgrades to them (each one is a button). The multi-face view is a child of the single face view, so when the dice are rolling, I don't need to see/render the multiface view, but since it is attached to the single face view which does need to be rendered I have a problem.

mortal robin
#

BTW I'm also making a dice game at the moment πŸ˜…

mortal robin
#

I'm using 3D dice though

#

Though I do have a UI view to look at the faces

honest belfry
#

I think i've got everything running just about as smooth as I can (with what little skills and understanding i have) except for the render times getting out of controll with all the multi-face views being rendered

#

with 10k dice thats 60k buttons lol

mortal robin
#

Yikes.. yeah that's not gonna work

#

Do you need to actually draw them all? How could a user even click on 60k buttons

#

Or read 10k of them

honest belfry
#

When i run the game with all the offscreen images diabled, Camera.render runs in about 10ms, but when the images are active (even though they are offscreen), Camera.render runs about 30ms on the CPU

mortal robin
#

But for UI

honest belfry
#

I don't think its GPU though... its the CPU thats capping

mortal robin
#

Or basically summarizations of areas as you zoom out

#

Instead of drawing each individual thing

honest belfry
mortal robin
#

Yeh it's complicated

honest belfry
honest belfry
# mortal robin Yeh it's complicated

I think i can set the layer of the child object (multiview) as different from the parent and then use the Camera's culling mask to not render that layer... As long as i can change the culling mask efficiently at runtime?

honest belfry
honest belfry
#

Ok I ended up just reparenting the child object on instantiate to a new canvas group where I can set the alpha… Hacky but it seems to be working

rapid ferry
#

I'm new to Unity and I'm trying to setup a start menu for my game, but when I hover over the button on the GUI, there is no visual difference. I've been stumped for over an hour, and thought it was time to ask the community. I've read an article (https://answers.unity.com/questions/1365672/buttons-will-not-change-color.html) on the Unity forum that was useless, and I don't know what else to do.

mortal robin
#

Or the whole thing doesn't work

rapid ferry
#

I'm not sure.

#

I'm setting up the scripts right now.

rapid ferry
mortal robin
#

Your image color is clear. That's your main issue I think. It's working fine just your color is invisible.

#

The various "highlighted color" etc for the Button component get multiplied by your highlight colors etc

#

TLDR:
Change your Color on the Image component to 100% white with full alpha

#

Don't forget the alpha, because that's the most important part

rapid ferry
#

oh

#

I see...

#

tysm

edgy owl
#

can someone help me? im trying to figure out why my buttons arent staying within bounds of my scroll rect

pearl briar
#

you can do what you want in a few ways. the built in scroll view has a mask that masks out things outside of the area of the panel.

#

if you want to force all the buttons to squeeze into your panel, you can add a vertical layout group

edgy owl
edgy owl
#

can someone help me figure out why my scrollbar is not working? I made sure I assigned it to the vertical scrollbar part of my scrollrect but it doesnt appear to be workin

random anvil
#

hi

#

Looking For a UI designer and UI developer

frosty pewter
honest belfry
#

Is there a way to set up a button to repeatedly call a function while held down without a script? I thought a button + event trigger component would work, but I can only get it to register on click, not click + hold

glass cloud
#

Is there a way to dynamically divide the column equally from a container. The container transform is set to stretch stretch

fierce oak
#

How does one set TMP's (not UGUI) to be rendered within masks like sprites can (visible inside mask) instead of outside?

#

you know what

#

I'm kinda dumb

#

realized my mistake as I was describing it

#

baka brain

jagged monolith
#

it be like that sometimes

digital kayak
weak dew
#

Should I be scaling UI elements with Scale or should I be adjusting the width/height?

weak dew
sterile wedge
weak dew
#

ahh ok thanks

sterile wedge
#

it's not a hard no no, but definitely recommended

weak dew
#

yeah i did notice in one of my prototypes scaling sliders messes them up alot

sterile wedge
#

if you're only scaling to like.. 1.1, and maintaining the aspect ratio, it's okay

#

i do it when I want the children to scale up with it, and I didn't set the anchoring for them properly XD

#

but only small amounts

weak dew
#

I would also like to know if spacing out icons via code is the proper way to do it. I made a turn based battle system before and I spaced out icons via code i.e. x+10.

sterile wedge
weak dew
sterile wedge
#

i wouldnt say proper or not. it's just whether you want to code it yourself, haha

weak dew
#

one problem i thought of with spacing UI images through code is that I would have to adjust it based on the resolution that the user chooses

#

i dont want it to go off screen or look wierd

sterile wedge
#

yeah, in that case, using one of the layout groups might make that easier

#

there's grid, horizontal, and vertical

#

take some time to tinker with them. They require some fiddling

weak dew
#

yep it seems like this is what i was looking for

sterile wedge
#

also helpful is the Layout Element component, for cases where you want the element in your layout group to have some unique setup

weak dew
#

its great, it auto spaces everything out wayy less work.

sterile wedge
#

great

vernal bison
#

Is it possible to use SVGs as images?

rapid ferry
#

can someone help me? why doesnt the ui text appear in the scene but not in the game

#

anyone?

rapid ferry
#

xD

#

weeelp

mortal robin
glossy pilot
#

how do i open that ui editor

#

where i can see alignment

#

if it's on the center etc?

mild kernel
glossy pilot
# mild kernel Don't crosspost please. That only appears on objects with a RectTransform comp...

Let's make a way to reach new levels!

● Download the Project Files: http://devassets.com/assets/how-to-make-a-video-game/

β™₯ Support my videos on Patreon: http://patreon.com/brackeys/

Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·

This video is part of a mini-series on making your first game in Unity.

Β·Β·...

β–Ά Play video
mild kernel
#

Show a screenshot of what you're selecting including the hierarchy in which it resides.

glossy pilot
#

where he goes 2D and focuses on F

#

@mild kernel

mild kernel
#

Right and the issue is what? The inspector would show the anchoring on the RectTransform.

glossy pilot
#

and when i focus on it misses the grid

glossy pilot
#

when i move the object example text i can not see text being aligned like how he can

mild kernel
#

You mean the scene grid? Turn it on by clicking the grid button at the top of the scene window. Though, it's not really that relevant for placing UI.

glossy pilot
#

i had the grid and when i move a ui component

#

a line pops up if it's at the center for example

#

or on the far right

mild kernel
#

You mean snapping to other edges? Right now your panel is the full size of your canvas. If you were to drag an edge of that panel, it should highlight the edge of the canvas or say the text's bounds as you got near to align with it.

glossy pilot
#

yeah ima just quit this for a bit

umbral thorn
#

Scroll content disappears after trying to scroll on Android, on different aspect ratio devices.

I have some scroll panels set up and in the apk build version they work great on newer devices like Huawei P30 Pro, Oneplus 8 Pro, Samsung S8 Plus, but the content of these scroll panels disappears (gets invisible) after trying to scroll on my older devices like an Asus Zenfone 4 or a Samsung Galaxy Note 10 2014. This app is forced to stay in portrait mode, and all the devices that had a problem with the scroll content disappearing were 16:9 aspect ratio. The other devices that had no problems had wider aspect ratios. What can I do to solve this problem?

mild kernel
# umbral thorn Scroll content disappears after trying to scroll on Android, on different aspect...

Firstly, don't spam your questions around the discord. Use a single channel (left this one).

Secondly, you can change your aspect ratio in the game window to test on that, or use the device simulator package to see what the app looks like on specific devices.

My guess is that it's not anchored correctly and you positioned it with a larger aspect ratio set, so when it shrunk, the object simply stayed off screen.

#

You would have to confirm that's the case by changing your ratio in the game view and seeing what happens in editor with the object. Then if that's the case, you'll have to rework your UI with proper anchoring.

umbral thorn
#

Thanks! Sorry for the spam.

kindred mist
#

I'm trying to give some text some highlight and it seems stupidly hacky with textmeshpro

#

anyone used mark tag before?

#

textmeshpro is so dogshit holy fuck

bronze marlin
#

Is it possible to make an image that receives raycast events but does not block them? Like it would still get pointerdown/hover events, it just wouldn't block them from being sent to the image behind it.

rapid ferry
#

how do i fix

#

uh

kindred mist
#

tf did u do lol

rapid ferry
#

Converted normal text to tmp

#

But it's all good I fixed it

sterile wedge
rapid ferry
#

got a different text assets

rapid ferry
#

Hi

#

My dumb ass again

#

How do I play a gif on a ui canvas

sterile wedge
rapid ferry
#

Uhh the fact that my dumb ass cant use a spritesheet

mild kernel
#

You can use an animation on an Image component and change the sprite.

limpid shale
#

is there a good way of putting a button within a paragraph of text?

#

like something like a hyperlink in a paragraph on a website

sterile wedge
limpid shale
#

oh cool! Ill have a look for it

#

must have missed iot

serene sparrow
#

How do I convert from an anchored position vector to a screen space position vector?
i.e. If my canvas is 384x216, and the screen resolution was 1920x1080 at the time.
Then an anchored position of -192, -108 should be the bottom left, and when converted would be 0,0.
And 192, 108 is the upper right, so would convert to 1920x1080

weak dew
#

How do you approach menus that aren't on one row/column? I'm working on a menu that's 2x3. My approach currently is to have two lists that contain the transforms for each column but I feel that it isnt very dynamic.

To add more info:
I plan to let the user use key button puts like ASDW to navigate rather than only the mouse

naive hinge
#

how would i make regualr text render more clearly

#

?

mild kernel
#

Use TextMeshPro instead.

naive hinge
sterile wedge
naive hinge
#

k

naive hinge
naive hinge
sterile wedge
#

If your IDE is configured properly, it will tell you what you need

naive hinge
#

ok

sterile wedge
#

Hint, your problem is that you need to import the text mesh pro namespace

#

But i want you to learn to figure that out

naive hinge
#

ook

naive hinge
#

Assets\scripts\dialougemanager.cs(9,9): error CS0246: The type or namespace name 'TextMeshProUGUI' could not be found (are you missing a using directive or an assembly reference?)

sterile wedge
#

I know that it is that, haha. But i want you to learn to debug πŸ™‚

naive hinge
#

k

sterile wedge
#

Do you see red underlines in your script

naive hinge
#

ye

sterile wedge
#

Good. Means it’s configured

naive hinge
#

k

sterile wedge
#

Right click the TextMeshProUGUI

naive hinge
#

k

sterile wedge
#

do you see there’s the first option like.. quick actions bla bla

#

Click that, look at the suggestions

#

There should be one that tells you what namespace to add

naive hinge
#

it says no quick fixes avalible

sterile wedge
#

Take a screenshot of your whole IDE please

naive hinge
sterile wedge
#

Spell it properly and try again

naive hinge
#

k

#

it only gives me these options

serene sparrow
#

@weak dew Have you looked at Grid Layout Group?

weak dew
serene sparrow
#

If you're using Unity's buttons and other UI, you should able to navigate them automatically with gamepad. Keyboard input would depend upon how your inputs are handled

naive hinge
#

@sterile wedge

weak dew
serene sparrow
#

@weak dew Nope. Unity builds a navigation graph for its own selectable controls, and if you don't disable it somehow, it will know what's to the left of your button if you push left, and then select it for you

weak dew
#

Im also using the new input system

serene sparrow
#

It will still work with the new input system
As a trial run, just place a bunch of buttons down in a canvas and see what happens when you move the gamepad

#

If you can't use unity's controls, then you'd need a script to manage a group of controls in a grid layout group
The script would wait a frame, to ensure the layout group had moved everything, and then go through its children to find the controls and where they're placed, and make a 2d array of them
Then that group needs to listen for input, and move the selection accordingly, or click the control, depending on the input
If controls get added/removed, it needs to wait a frame and then refresh the 2d array

weak dew
naive hinge
#

how would i make this ui less blurry

weak dew
mortal robin
calm plover
low pike
craggy geyser
#

My UI renders in Scene but not in Game View. Any idea ?

#

Lol, it had to do with the position

#

z was -1000

woven igloo
#

how can i make my UI text interactive to different screen sizes ?

#

the text size

woven igloo
mortal robin
#

Then write a script I guess. Canvas scaler is the built in way to do it.

steady robin
#

Hey how can I make a auto scroll cards ui like this?
https://youtu.be/Phz882tKBh8

Featuring JioSaavn

Immerse yourself in the magic of JioGlass and sing along with your favourite artists. Play any song, album or playlist on demand while enjoying a one-of-a-kind spatial audio experience. 🎸🎷

JioSaavn allows you to listen and interact with more than 10 million tracks of the world's largest music collection, with a 3D visual ca...

β–Ά Play video
topaz flume
#

How are login screens and character creation workflows generally? I’m super new to unity, right now I just disable the canvas for login and afterwards enable the another canvas for character creation and so on.

fervent pilot
#

I feel like I'm missing something that shows this code occurring on the UI.

                if (hit.collider.gameObject.tag == "Enemy")
                {
                    for (int i = 0; i < reticleGraphics.Length; i++)
                    {
                        reticleGraphics[i].color = Color.Lerp(reticleHiddenColor, reticleColor, reticleFadeTime);
                        reticleGraphics[i].fillAmount = Mathf.Lerp(reticleFill / 2, reticleFill, reticleFadeTime);
                    }
                }
serene sparrow
#

@topaz flume Bunch of ways you can do it.
Turning on/off canvases
Turning on/off canvas groups
Turning on/off image panels in one main canvas

topaz flume
#

@serene sparrow I figured it all out! New question, is there a way to add effects to images such as blur?

serene sparrow
#

That I don't know, been mostly doing retro pixel perfect UI without transparencies

granite beacon
#

has anybody here tried the Vector Graphics package?
im thinking of using SVG files with my UI, but im not sure if I should use a package still in preview so im looking for some feedback

mortal robin
#

Yes I've used it. It's fine as far as the basic features go.

umbral thorn
#

Can anyone help me with this?

elder crest
#

Can anyone tell me why a UI button/toggle wont click or highlight on hover?

#

my canvas has graphic raycaster on, my buttons are interactable and all on

#

i set up the same thing in a new project and it works fine, but in my existing project it acts like my mouse cant reach the canvas

sterile wedge
winter notch
#

hi i have a problem... I did a Canvas and made a game with this canvas. The problem is that until now the canvas was scaled on a constant pixel size, and now that i try it using Scale with screen size... well i have a really really bad surprise so if someone can help me to scale this thing it would be greatly appreciated

#

also how to know the scale of the free aspect?

elder crest
weak dew
#

Is there a way to keep a UI element constant even in world space? Alternatively, is it possible to position a UI element NOT using world space to where an object is ( i doubt this one)? I have an HP bar using world space but the scale is inconsistent because certain targets are farther away

modern frost
sterile wedge
modern frost
#

I have tried that but it still doesnt seem to work.

modern frost
#

i fixed it. Just forgot to animate the normal animation

narrow meteor
#

So my world space ui that is behind gameobjects cant register clicks. Ive two cameras, one for UI and for everything else, everything is set to correct layes, what could be the problem?

EDIT: the ui that is above gameobjects works totally fine

pale grove
#

i am trying to spawn prefabs into ui set to camera mode with a screen scaler set to expand, however whenever i spawn it at a different resolution they spawn weirdly, what should i try to do to fix this?

limpid shale
#

Is there a good way of scaling a mobile UI?

#

Canvas scaler with a 1080 x 1920 reference cnavas doesnt scale nicely

#

bits of the screen get cut off instead of scaling smoothly with the screen

#

wait nevermind

limpid shale
#

okay, I tried the scaler and it looks great in. editor mode, but its completely different in play mode and nothing is interactable

#

it was working. before hand

#

ah

#

hidden overrides

rapid ferry
# umbral thorn Can anyone help me with this?

I got this issue and the fix for me was setting the targeted frame rate to 90 or 60, setting the max to a high number caused the scroll rects to have NAN errors when going in a negative direction

obtuse pasture
#

Guys I'm ripping my hair out trying to figure out why my OnPointerEnterHandler and OnPointerExitHandler events aren't firing

#

The related canvas&canvasgroup aren't being obstructed by anything and are drawn last (bottom element in canvas child hierarchy)

#

There is an eventsystem in the scene too, some other UI logic that I implemented works perfectly

sterile wedge
obtuse pasture
#

@sterile wedge tried that too.

#

Feels pretty cursed, I made a complete empty project with just my script and the basic UI elements and it does not seem to trigger OnPointerEnter or Exit events

#

blocks raycasts also does not block raycasts, contrary to what you would think it does

humble frost
#

Layers?

obtuse pasture
#

nope

#

good guess though

#

Unity UI is just such a joy to work with

#

my god I can't believe I'm doing this on my own time lmao

jagged monolith
#

@obtuse pasture with issues like these the best way to find out what's happening is selecting the EventSystem to see its values

umbral thorn
oblique sun
humble frost
#

I was searching through my project, because I was sure I had exactly what you describe @oblique sun. A Pointer transition class that also needed to have OnSelect or OnClick implemented in order for it to work. But I couldn't find the class and was starting to think I'd imagined it.

oblique sun
#

Yeah, see, exact same situation. Almost everywhere I have OnPointerX, I also have OnSelect. I'm pretty certain that's also because of some "gotcha" in the past.

#

But now I can't find evidence of it anymore either.

humble frost
#

Found mine

#
public void OnPointerDown(PointerEventData eventData)
{
    // Do nothing. Just need it so this component gets marked as the interacted object
}
#

But I'm only using PointerUp and Down handlers in that class, and Scroll and DragHandlers in its parent class.

oblique sun
#

I've actually asked colleagues because it's bothering me now. XD

dim prawn
#

So my friend is having an issue where every time she plays her game the buttons on the UI disappear, any thoughts on why?

empty juniper
#

I have an image that has some parts of it transparent, but when I add it to unity those transparent part get filled with color. What should I do?

hexed pumice
#

How can I make the text appear in front of the dropdown UI?

jagged monolith
#

On a UI image @empty juniper? Is the texture set to sprite mode?

jagged monolith
empty juniper
jagged monolith
#

Can you show a screenshot

empty juniper
#

And here is the texture in the scene:

jagged monolith
#

Can you share the texture file?

lime kindle
empty juniper
#

it is a png

jagged monolith
#

Have you changed any of the parameters under Advanced @empty juniper?

jagged monolith
empty juniper
#

thanks

subtle vapor
#

Hey I have a black, very transparent UI button. When I hover over it, I want the highlight color to be black but with less transparency. But somehow this doesn’t work. It only works if the image color is white or a gray :/

mild kernel
#

Instead change the source colour to white, and change the normal colour of the button to black+transparent.

naive trellis
#

i have a scene which is the gameplay scene and when the player dies a gameover ui screen pops out (its still in the same scene) but when i hit retry button(which reloads the gameplay scene) the player model becomes black

#

here its normal

#

here after i hit retry and reload the gameplay scene

#

also when i press play from the main menu same problem is happening

rapid ferry
#

Hey guys, I am working on subtitles, and was wondering if there was any way to bring the text down according to the number of letters? So for example, only one line would be like 100 up, but if the subtitles have 2 lines, it would be 200 up

#

and vice versa. Please ping me if you have an answer. Thanks

deft zinc
#

why dont I get a box around the text mesh pro child on my canvas, I can't see its rect

weak dew
#

What is the cause of the grainy distortion of the text? Im using world space and I made sure eveyrthing is scaled to 1

mortal robin
weak dew
mortal robin
#

What size did you make the canvas

mortal robin
weak dew
naive trellis
glad citrus
#

Creating ui is hard

low pike
#

Is it possible to set a max width on something? The tags are dynamic, if something ends up with more tags than the width of the screen, it goes off screen (I put it on two lines manually for this gif)

small finch
#

sooo that red square is my background and i want to put a button on it but when i try the canvas and button are both massive compared to it

#

how can i fit it with the red square

craggy geyser
#

Are there any fonts like this for textmesh pro ?

sterile wedge
mortal robin
raven rover
#

hi quick question, how do I get my image to not stretch over the border like this

small finch
sonic prairie
#

How do I only show one image in front of another? I don't want the image to be displayed at all if it isn't behind another image

rapid ferry
small finch
steady robin
#

How do i mask the 3d models i have placed on the scroll view?
I googled it and saw a few non-useful answers on unity forum,stack,etc.

#

this is my unmasked complete scroll view content

#

This is the masked or partially required one.

You can see the apple and mango are not masked but their buttons are. How do I mask both of em>

mortal robin
#

What are they?

#

MeshRenderer? SpriteRenderer?

manic ferry
#

hi

#

I changed the platform to andriod in my unity project. Now I put an joystick in the game on the canvas. Is it normal, that i cant click it now with my mouse?

steady robin
steady robin
mortal robin
#

they are using MeshRenderer

#

which cannot be masked with UI or sprite mask

steady robin
#

So what do i do?

mortal robin
#

find another way to mask them

#

you will need a custom shader if you want to partially mask them

steady robin
#

Yeah that's what I'm askingπŸ˜„πŸ˜„

mortal robin
steady robin
mortal robin
#

?

steady robin
#

It was some problem with tags

#

Geometry tag

#

Maybe my gls version is not supported with that type of tag

mortal robin
steady robin
#

sure

#

thanks for replying

full elbow
#

how can I get rid of this? UI is very big

mild kernel
#

If you want UI to be a world object in your scene, then change the canvas to be in World Space.

azure flame
#

Also can hide UI display in Layers

full elbow
#

Nono, I know, I mean, it's kinda hard to work like this. Is there a way to make it smaller in the editor?

azure flame
#

It's not related to the world space. Displayed separately.

uncut sage
#

how do i make a button with round corners? i've read i have to slice a rounded button but for me that isn't working, it stays too rounded

azure flame
uncut sage
#

just look how mine looks

azure flame
#

higher pixel per unit also does this (sharper corners)

#

you don't have side slices

#

It's a 9 slice not 4 slice

uncut sage
#

i dont? i put everything 40 just like in tutorial

#

the guy also has 4 slice

#

oh

#

the higher pixel works indeed, thanks

plain totem
#

I'm trying to show/hide an UI element by serializing the GameObject and using SetActive(). However I think it's not working because the GameObject is a prefab and it's not referencing the actual GameObject in the scene, is this what's happening? Should I not use a prefab for UI elements? I don't instantiate them where I'm using SetActive().

Just asking here before I make any changes because it doesn't feel right to instantiate a UI element (a menu window, to be more precise.)

weary stirrup
#

I'm trying to make a UI, but whenever i set my Ui's opacity to 0% it shows as 0% in the editor, but in the gameplay mode it has some level of opacity. Does anyone know what I could be doing wrong?

info on UI:

uses the outline component (yes that is set to 0% too)
is a button, and has default button settings/colors with opacity set to 0%

darker img is in gameplay mode
lighter img is in editor mode

mortal robin
quick willow
#

I want to have a different Sorting Order for my UI Elements. I know it would work if i change the Hierachy, but i feel this is a bad way of sorting it in the End. Anybody knows how to properly set this up?

sacred sparrow
#

how can i make a tmp button not be able to be selected

#

i dont want to have there be leftover tint when i click I just want to click it, the tint shows, and dissapears.

mortal robin
#

Use a regular Image component plus an Event Trigger component

#

and set a listener for the pointer click event

#

Or just set the selected color of the button to be the same as the "default" or normal color

cosmic herald
#

is there a setting in unity to set a certain font as the default? it would be nice to have it automatically set the correct font in the ui elements

rapid ferry
#

If you use text mesh pro then yes

lapis swallow
#

I'm testing my game in free aspect and I noticed that some window resolutions produce these kind of lines.
I'm using cinemachine and pixel perfect component. I would like to know if there is a way to pinpoint which resolutions might cause this and perhaps have a method that finds all these resolutions so I can skip them with a custom method I have for when the game window gets resized.
Edit: for reference this screenshot had a game window resolution of W: 1840 H: 508

lilac moon
lilac moon
#

so... wierd issue that has been plaguing me for several hours - am generating a menu at runtime - image and tmp as part of prefab, generating a button on init. Everything is fine when playing in the editor, but after building the images do not show. The tmp text is updated and the buttons still function though! any ideas?

weary cove
#

Help, I don't know what I'm missing. I'm trying to place an animated sprite in the UI as an image and it won't budge no matter what I do. Hope the screenshot works.

jolly gust
#

Hi, I have a score and timer in the top left/right of the screen but sprites are appearing in front of it

#

Even though the text is on a higher (the ui) layer AND has a higher z position??????

#

Nevermind, found a fix

willow ether
#

How would I go about snapping a panel to the top of a scrollrect?

#

im trying to create multiple new panels for each inventory item instance, but im just trying to get them to dock to the top of the panel

quick willow
#

I want to have a different Sorting Order for my UI Elements. I know it would work if i change the Hierachy, but i feel this is a bad way of sorting it in the End. Anybody knows how to properly set this up?

lilac moon
quick willow
#

Thanks i will try that. Where can i find the dictionary?

lilac moon
dense harbor
#

Does anyone know how to fix your custom cursor being all blurry?

rapid ferry
#

question.. when i adjust my resolution the UI elements should change their size.. but they dont unless i close and reopen the game... what can I do to change the scale of all UI elements when i change the resolution WITHOUT closing the game

rapid ferry
jagged monolith
#

can you show what it looks like and what you want it to look like?

rapid ferry
#

sure**

rapid ferry
#

sorry

glossy cosmos
#

no

rapid ferry
#

What do you guys think of this?

spiral falcon
#

Hi guys, I am making ui for mobile and checked on my mobile and it's looking good but phone screen size is 6 inch and concerned how it will look on smaller devices.
Whether the button will become too small to tap or text become to small to read.
Any tip ?
I don't have a mobile with small screen
πŸ˜…

white cloak
#

is there a maximum character limit for TextMeshPro Text . i noticed that it would start to cut off around 99,910 Characters. However, the scrollrect still expands beyond that based on what should be shown if the characters were there. Is this a limitation of the UI component or of the string itself?

broken cloud
#

where can i find free realistic item icons?

honest belfry
#

Is there a way to underline a portion of text in a TextMeshProUGUI? It seems to me that you can only underline all the text or none of it...

maiden fable
#

Anyone know why my UI is still changing size when i have it set to constant pixel size??

mortal robin
mortal robin
maiden fable
#

Nvm i think i figured it out. Thanks!

rapid ferry
frigid pelican
#

Anyone know what would cause TextMeshPro text to have issues with rendering in game view (possible multiple transparency layer issue?)

Looks totally fine in Scene view , but then terrible in game/builds

real arch
frigid pelican
real arch
#

ah nice

frigid pelican
#

its an obscure setting under the "Debug Settings" below Outline/Lighting/Glow on a textmesh component (and probably somewhere on the font atlas too)

#

thanks for ur help

real arch
#

thanks for sharing what did fix it for you πŸ™‚

inland gyro
#

Hi, I didn't know exactly where to ask but I can't seem to figure this out. I have some ui (and I'm not used to working with ui in unity) that I'd like to have the two keep the same height relative to each other (like two panels in a box in some other ui systems). I just have no idea how to accomplish this and nothing I try works.

civic notch
#

Hey, im creating a scrollview/viewport/content layout. For some reason the content is not aligned to the center

#

In Content object, my ChildAlignment is center, and i have no uneven padding for content, viewport, or scrollview

#

Pivot is centered too..

#

OKAY. It was infact padding, under grid layout group, there was an option to extend a view to see padding, there i apparently had some πŸ˜„

hexed harness
#

So I still have this problem:
I have a video, that plays when the game is loaded.
It's render mode is set to camera far plane
But it also seems to take time to load, so the screen is transparent for a while, and then the video is loaded. Is there a way to add the video loading time to the scene loading time so you can't see a empty scene for a while?
The video is gotten from a web server at the moment
The delay is likely because the video needs to be buffered. So a solution could be, to call the VideoPlayer.Prepare() method, and only switch to the scene once it is prepared. But since this is the first scene that is being loaded once the game is started, this wouldn't work.
Question one: Maybe it is possible to add the loading time to the game loading time at the beginning?

If that is not possible, there could be another way, by making a loading screen scene and starting in that scene, until the video is prepared.
Question two: Is it possible to prepare a video from another scene?

Another solution would be to just put an image of the first frame of the video on the canvas, but that doesn't seem to work for two reasons:

  • The video plays behind the image, so it can't be seen.
    Question three: How do I fix this?
  • The image scales differently on different aspect ratios then the video for some reason. The video player scaling is set to 'Fit Outside'. It is described as: Scale the source to fit the destination rectangle without leaving black areas on the left and right or above and below, cropping as required. The source aspect ratio is preserved.
    Question four: is there a way to replicate that scaling behavior on a UI plane?
tidal merlin
#

hi

#

can anyone help me to solve this problem

#

?

real arch
# tidal merlin

what are the settings on your canvas?
why is it under the player?

willow ether
#

Is there any way to force an inputfield to stop being focused?

mortal robin
boreal marsh
#

Why is this a thing? 😐

rapid ferry
#

Does anyone know if there is a way to trigger a button's Click event on an input action? For example, press A on a gamepad and have the button appear to have been pressed. I can invoke the OnClick event easy enough, but the button art doesn't respond as normal

lilac sentinel
#

how do I get rid of this annoying "T" with textmeshpro?

frosty pewter
#

Find it in the Gizmos menu and click the icon next to the entry

#

@lilac sentinel

lilac sentinel
#

thank ya

lilac sentinel
#

I have a UI system that works off of .SetActive statements, and my main UI constantly updates every frame, however when it is set inactive and then back to active again, the text doesnt update and goes to default

#

these are the only lines of code responsible for working with these two UIs

mild sparrow
#

Is there a way to dynamically change the position of a left or right aligned TextMeshPro text to place it where it would be if it was center aligned?

neon terrace
#

i have a weird issue where my SetText functions doesn't work anymore. It worked before but something broke and now none of my texts will work

#

and yes there are functions refrences to the text. i have a feeling when i fiddled around by the canvases (duplicating and changing the sort order on them that it somehow caused them to break)

mortal robin
#

Can you show what you mean about the outline?

neon terrace
#

wtf

mortal robin
neon terrace
#

there's a lot to show though so im starting with this

#

i can post some code though hang on

mortal robin
#

Try making your canvas pixel perfect

#

and also check the alpha of everything - could be a transparency thing?

neon terrace
#

should i drop the code here?

neon terrace
# neon terrace should i drop the code here?

This is applied to the ReadCanvas object

    [SerializeField] private float fadeSpeed;
    private TextMeshProUGUI readableText;
    private PLR_ReadText plrreadtext;
    // Start is called before the first frame update
    void Start()
    {
        readableText = GetComponentInChildren<TextMeshProUGUI>();
        plrreadtext = FindObjectOfType<PLR_ReadText>();
    }

    // Update is called once per frame
    void Update()
    {
        TextToDisplay(plrreadtext.textToDisplay);
    }
    private void TextToDisplay(string text)
    {
        Debug.Log(text);
        if(plrreadtext.isReading)
        {
            Debug.Log("ok");
            readableText.SetText(text);
            readableText.alpha = Mathf.Lerp(readableText.alpha, 1, fadeSpeed);
        }
        else if(!plrreadtext.isReading)
        {
            Debug.Log("no");
            readableText.alpha = Mathf.Lerp(readableText.alpha, 0, fadeSpeed);
        }
    }
#

The code for DeathCanvas is much much longer though so I can't really share it here, although that one works as intended. ReadCanvas is what is breaking everything. If i disable it, everything goes back to normal

#

@mortal robin good enough?

neon terrace
#

oh yea hold on

mortal robin
#

And what object(s) is it on?

#

Since you're using FindObjectOfType that seems a little sus

neon terrace
#
[SerializeField] private float viewingRange;
    [SerializeField] private LayerMask layerMask;
    private Camera playerCam;
    [HideInInspector] public bool isReading;
    [HideInInspector] public string textToDisplay;
    private void Start()
    {
        playerCam = Camera.main;
    }
    private void Update()
    {
        ReadText();
    }
    private void ReadText()
    {
        Ray playerAim = playerCam.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0));
        RaycastHit hit;

        if (Physics.Raycast(playerAim, out hit, viewingRange, ~layerMask))
        {
            Debug.DrawRay(Camera.main.transform.position, Camera.main.transform.forward * viewingRange, Color.yellow);

            OBJ_DisplayText objdisplaytext = hit.collider.gameObject.GetComponent<OBJ_DisplayText>();

            if (objdisplaytext != null)
            {
                textToDisplay = objdisplaytext.textToRead;
                isReading = true;
            }
            else
            {
                isReading = false;
            }
        }
    }```
#

PLR_ReadText is on the player and there is only one player

neon terrace
#

@mortal robin well then i fixed it

#

had to switch the position between death and read (previously, read was above death. now its the opposite)

#

how and why does that work, i have no idea. my assumption is that one of them layers on top of the other and blocks it

neon terrace
#

TextMeshProUGUI

#

and to update it, i usually do

String
TextToDisplay.SetText($"String");

Variable
TextToDisplay.SetText($"{Var}");

String & Variable
TextToDisplay.SetText($"String & {Var}");

rapid ferry
#

i have a problem with my scroll view, i dint move either tough are enough items, so it shold move when i scroll but it dont, any help please?!

indigo goblet
#

how r u controlling your ui? is there some kinda controllers or you using some frameworks?

white cloak
rapid ferry
#

Okay πŸ™πŸΌ

gloomy zephyr
#

Hello, I started making a UI for a game, However I ran into a Problem with my Horizontal LayoutGroup and Content Size Fitter. The problem I am encountering is when I enable the Content size Fitter inside the GreyBox_1 and set it to preferred, It sets the Width of the Box to 0. I can change the Text Box Perfectly fine and it resizes itself depending how long the text is. I just need to the GreyBox_1 to follow the text. Any ideas, please ping me

https://cdn.discordapp.com/attachments/497872424281440267/924128185145258034/unknown.png
https://cdn.discordapp.com/attachments/497872424281440267/924128185367547934/unknown.png
https://cdn.discordapp.com/attachments/497872424281440267/924128185564676106/unknown.png
https://cdn.discordapp.com/attachments/497872424281440267/924128185795346452/unknown.png

blissful oriole
#

I'm using textmeshpro for outlines within unity text, but it is applying to every single textmeshpro text as opposed to select ones. Is there an option I am missing?

#

Ah for future ppl who might be searching this, you need to change the material to a different one.

late mirage
#

Hello guys, I am new to unity, and I was working with Text mesh pro but the text isnt rendring in game mode and now i am stuck, need help.

long snow
#

Hello, how can i rotate image here so spikes are pointing to the middle of Particle system?

#

They were supposed to point to the middle

long snow
rapid ferry
#

Sorry if this is in the wrong channel, but every time I start a game in the editor, my font goes black.

#

If I delete and insert it again into the assets folder, it regains its colour.

spiral summit
#

@rapid ferry You can execute events directly on the event handler. GameObject will be the button and event will be for example PointerClickHandler

cursive coral
#

idk if im in the wrong channel, but i have this problem when i select the text thats in the canvas, the canvas goes invisible. is that normal? because it wasnt like that before

silent plank
#

So apparently, my game's UI is differently sized depending on the screen resolution
(as I saw in the Game tab of the editor, it looks bigger on low res and smaller on high res),
what's the "fix"?

#

I anchored the UI parts to the borders but only position-wise

mortal robin
#

"Constant Physical Size" mode might be what you want, or "Scale with Screen Size"

silent plank
#

Haven't seen these settings before, I should look better

#

thanks anyway

long snow
#

Hello, how to make particles to be seen in ui?

#

I made a particle system in canvas but its not showing in game as a ui part, how can i change it

mortal robin
long snow
#

So is it possible to make some particles visible if i sprint?

mortal robin
#

Why not

#

Anything is possible

long snow
#

You said that i cant

mortal robin
#

You can't draw particles on the UI

#

Unity's particle system is a world space thing

#

but you can draw particles in front of the UI, using the workaround I described above

long snow
#

hm, okay

silent plank
obtuse burrow
#

Hello! I watched this tutorial (https://www.youtube.com/watch?v=8yzpjkoE0YA) and I was wondering a few things:

  1. Can I do this in run-time above my character’s model?
  2. Can I display a different game object every few seconds with script?
  3. Can I have multiple characters on the screen and display a different item like this for each character (above their head)?

Ever wondered how to add a 3D object to your Unity canvas? This is great for screens like weapon select, inventories, skins, etc.

I see this question asked a lot so figured I'd make a quick tutorial on the matter.

If you enjoy my content, you can support me via Patreon: https://www.patreon.com/tarodev
Alternatively, you could use my affiliate ...

β–Ά Play video
gloomy zephyr
#

Anyone see the problem why when I start my UI, It puts all my Felone_1 _2 and so on all on top of another? Once I click in the Hierachry on one of the Felonie it puts them back in order?

#

I've been trying to figure out the problem for a while and cannot find it at all

silent plank
# obtuse burrow Hello! I watched this tutorial (https://www.youtube.com/watch?v=8yzpjkoE0YA) and...

(don't miss these guys' questions above, everyone deserves support! ^^')

So I have another issue with my UI.
I'm following tutorials from YouTube and I've made a health bar (made of a border and a filling).
The filling is connected to a variable and is meant to use a color gradient system, but the filling has a default color that it just sticks to instead of changing depending on the color gradient.
What can I do to make it functional (hopefully the attachments help you understand the issue better, and that I made myself clear)?

agile harness
#

What value is slider.normalizedValue

silent plank
#

slider.normalizedValue, according to the tutorial, normally corresponds to the Slider's value "normalized" so it's a value between 0 and 1 (to read the gradient)

agile harness
#

Your gradient runs 0-6

silent plank
#

The gradient is meant to go from 0 to 1

#

that's how it works in Unity if I'm not mistaken

agile harness
#

You have 0 and 6 as min max on img 2

#

Might be making issue?

silent plank
#

for example

#

2 out of 6 is 0.33

#

which is in the interval [0,1]

#

(basically between 0 and 1)

#

so it should be alright

agile harness
#

what happens if you were to print out some direct numbers of the gradient

#

Do like, 0.1f, up to 3.0, with a few intervals

#

Print out/log gradient.Evaluate(0.1f) and others

silent plank
#

You mean, if I try to get values for specific points of the gradient?

agile harness
#

Yes

#

With floats

silent plank
#

how can I display such value

#

I might've just forgotten

agile harness
#

eeeeeeeh

#

i dont do the scripting on our unity projects but i wanna say Debug.Log()

#

Think I've seen that recently today

silent plank
#

I'm forced to go to bed so I won't be able to directly make tests now, gonna wait till tmr (8~9hrs)

#

will still be checking this channel for a bit

gloomy zephyr
#

Im loosing my mind with it

gloomy zephyr
#

Please anyone help me...

#

I've put many hours trying to fix this but nothing works

mortal robin
#

is making it height of 0

gloomy zephyr
#

Its not though?

mortal robin
#

or the layout group's doing it?

#

idk

gloomy zephyr
#

I legit have 0 clue....

#

I've tried remkaing it from scratch a few times

#

Just the same thing happens

#

At 1 time, I got it to set the position correctly. However the The other Felonies didnt move down when the other text boxes got bigger

mild kernel
#

This is an issue when you child content size fitters inside other ones.

gloomy zephyr
#

So I shouldnt have one in each of the Texts?

mild kernel
#

A hack is to try Canvas.ForceUpdateCanvases(); or LayoutRebuilder.ForceRebuildLayoutImmediate(...); to try to get it to refresh at runtime.

gloomy zephyr
#

Well, Im just making a UI for the game. Sadly the game that it is for dosent allow scripts to be used.

#

Its eaither I get it so when I update the Description and make it longer, The Background follows it correctly and then when I click play on it, It makes them all go to 1 area. Or I get it to stay in the correct spots however when I try to update the Description to make the box bigger. it dosent push the other boxes down.

#

I just dont understand at all...

#

It acts like the Spacing does not exists at all....

gloomy zephyr
#

Well. I watched a few other videos on Verticle Layout Group trying to fix it. Still nothing. I am getting that same problem.

#

So Far I spent 3 hours and no progress on this issue yet. If anyone got any idea. Please.... Please ping me... I need this to work

warm wolf
#

Also, is there a way to automatically find all used images in a folder and add them to a sprite atlas? - I have hundreds of images in a folder but only ~100 are used, want to automatically get all the used ones into a sprite atlas to save on batching

old cape
gloomy zephyr
#

Well. I turned on Height on controlled child size and it seemed like it fixed it.

mild sparrow
#

Hoping to revisit this question as it's a bit time sensitive -- Is there a way to dynamically change the position of a left or right aligned TextMeshPro text to place it where it would be if it was center aligned?

#
i.e.
             The quick brown fox jumps
             over the lazy dog

vs.

The quick brown fox jumps
over the lazy dog 
inland obsidian
#

How do I prevent the camera from becoming bigger in the exported project? This is the camera in the game view as it should be:

#

And this is the exported camera view:

#

Or is it mandatory in order to look good?

mortal robin
#

A couple ways around this:

  • Show black bars (letterboxing) on the outside
  • Force the game to run in a certain aspect ratio
#

The third option is:

  • Stretch everything to fit
    but that'll be ugly
inland obsidian
#

Ok thanks

fickle geyser
#

hello guys, I would like to make a toggle (with a check mark) which plays music, when it is on, but when it is off, it doesn't play music, could someone help me please? Thank you

magic walrus
#

im not sure if this is the right channel to ask but it's part of my UI so i figure ill put it here. i have these images to represent units in my game in a shop. the one on the right i like, its higher quality than the rest and came with that asset i bought. but i dont really know how to go about creating higher quality images for the other units. any suggestions?

fickle geyser
#

i think you could make a new scene with the models you want to have in the images and create a background behind them, (like the one on the right for example) and then take a picture from the angle you like and use it

#

Talking about the quality of the photo you could use shaders or post processing, or play with point lights, or directional light, or spotlights

magic walrus
#

ill give it a whirl, thanks

fickle geyser
#

your welcome

stone pivot
#

Do sprite atlas work automatically or I have to assign sprites manually using script ?

silent plank
worthy karma
#

Are buttons on worldspace canvases clickable?

agile raft
#

yo guys, what is the best mode to set UI Scale Mode in canvas to support different display?

supple vale
#

Hello, I am using Vertical layout group and want to spawn knive images. it is spawned from up to bottom but I want it reverse.

#

this is what I mean

#

I want it to go upwards when adding

peak quarry
#

How do I remove this error when using a Unicode character (specifically, the leftward arrow ( \u2190 | ← )) when using it with TMP?

Error:

UnityEngine.Material:GetFloat(String)
TMPro.TMP_SubMeshUI:ON_MATERIAL_PROPERTY_CHANGED(Boolean, Material) (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Runtime/TMP_SubMeshUI.cs:360)
TMPro.FastAction`2:Call(Boolean, Material) (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Runtime/FastAction.cs:109)
TMPro.TMPro_EventManager:ON_MATERIAL_PROPERTY_CHANGED(Boolean, Material) (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Runtime/TMPro_EventManager.cs:41)
TMPro.EditorUtilities.TMP_BaseShaderGUI:PrepareGUI() (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Editor/TMP_BaseShaderGUI.cs:144)
TMPro.EditorUtilities.TMP_BaseShaderGUI:OnGUI(MaterialEditor, MaterialProperty[]) (at Library/PackageCache/com.unity.textmeshpro@2.1.6/Scripts/Editor/TMP_BaseShaderGUI.cs:158)
UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()
#

Do I have to regenerate the font?

neon terrace
#

I have an issue where my canvas wont recognise my buttons at all. it wont even change colors when im hovering over the button. this is how it looks like on the hierarchy

#

this is what i have on the button atm

neon terrace
#

hmm it doesnt recognise my cursor at all

mortal robin
neon terrace
#

i had one, but it was outside the UI prefab, although now i moved it in and it still won't work

#

but the answer is yes

mortal robin
#

Does it have an Input Module on it?

neon terrace
#

Input System UI Input Module?

mortal robin
#

Yes

neon terrace
#

then yes

mortal robin
#

Can you show a screenshot of the input module inspector

neon terrace
mortal robin
#

Ok that's good

#

Does your canvas have a Graphic Raycaster?

neon terrace
#

also should the input module use my own action map or should i leave it to default?

mortal robin
#

Leave default

#

Ok last thing probably is just that some other UI is blocking your button

#

Or you have a canvas group that's set to not Interactable or something

#

Try disabling all your other UI elements

#

Until it works

#

And you'll find out what's blocking it that way

neon terrace
#

well disabling my other canvases did make it work

#

but should i add a canvas group to all of them and set to interactable?

mortal robin
#

I don't think I understand your setup enough to make a recommendation

#

But you know what your problem is now so you should be able to figure out a way around it

neon terrace
#

yeah true

#

but thanks a lot now!

#

nvm found the issue

#

the variable Sort Order on the Canvas component. Had to pump it up and make it above the other canvases

rapid ferry
#

My sprite is not showing up on top

#

It's behind something of a lower sorting grou

cloud lintel
#

I want to have a TextMeshPro objects resize themselves based on their preffered width. I want them to be inside a HorizontalLayoutGroup so their positions get updated accordingly. I tried to use a ContentSizeFitter on them but it conflicts with the HorizontalLayoutGroup. Any way to acheive this?

spring lark
#

why my slider value switching script isnt working ?

#

I call its method to modify the slider.value and slider.maxValue to my object health and max health points, but its value doesnt change.

#

I tried switching parameters to floats instead of integers, doesnt change anything

mortal robin
spring lark
#

I ended up making it to work

naive trellis
#
    public void Quality(int qualityIndex)
    {
        QualitySettings.SetQualityLevel(qualityIndex);
    }

i'm using this to change graphics quality with a dropdown menu (brakeys tutorial) with on value changed set to Quality

#

however when i change the drop down the quality level stays the same

#

this is the dropdown

chilly lion
#

Am I correct in assuming that a Graphic Raycaster component is only required when you want to player to be able to interact with the UI directly?

mortal robin
#

It's required when you want the player to be able to interact with the UI via a pointer

slate remnant
#

Hello anyone using AR UI/UX with Android? Having some issue

sterile parcel
#

Hi, I'm guessing it's a common issue where using the standard way of navigating a menu using keyboard breaks once you click off or use the mouse or whatever. Is there a reliable fix for this that prevents the keyboard navigation from not selecting anything?

mortal robin
sterile parcel
#

Oh where do I find that?

#

Do you mean this?

#

Okay don't worry I figured it out

balmy cypress
#

is there any really good tutorials on UI? Id rather not end up learning outdated ways if possible

naive trellis
# balmy cypress is there any really good tutorials on UI? Id rather not end up learning outdated...

i can help you with main menu i found a good one here it is https://www.youtube.com/watch?v=Cq_Nnw_LwnI

Ever wanted to make your own main menu in Unity? Settings, Options, Graphics, Controls and and more! We'll learn how to create, design, add buttons, sliders, toggles, dropdowns and text elements. We'll learn how to code these elements and make our sliders affect text boxes, create dialog boxes, best practises. We will learn how to save this data...

β–Ά Play video
daring sky
#

Hi there,
not sure if I'm right here
does anyone know a way to prevent UI elements from showing their backside?

spice horizon
#

hey! is there a way to somehow create pixel perfect UI, specifically a crosshair, like in VALORANT? i'm currently using a simple image for crosshairs and changing its scale, both factors can be changed by the player, but it changes size depending on the user's resolution

#

the big problem is that with certain resolutions, parts of the crosshair disappear (for example while playing stretched like 4/3, 5/4 or even 1/1) and i'd like to have the crosshair be of a fixed pixel size, no matter the resolution

spice horizon
#

my canvas is using Scale with Screen Size, my reference res is 3840x2160 and screen match mode is on Match Width or Height with 0 being on stretched aspect ratios like 4/3, 5/4 and 1/1, and 1 being on ultrawide aspect ratios like 21/9 and 32/9.

strange sentinel
#

fairly slow paced, good practices, updates when hes wrong or if theres a better method and covers basically everything

drowsy marsh
#

Why does the value of my scrollbar always reset?

#

I want it to be at 1 but it always resets to 0.5

#

Works now, had a content size fitter

dense rose
#

Guys i want ask one thing, is there any chance to do something like this ? in photoshop you can make Clipping mask, do for example square will be visible only on sphere (Squere Red, Sphere Black)

sterile wedge
dense rose
#

i want do something like this, so image will be in image

dense rose
#

Okay, thanks it work ❀️

humble finch
#

So why is every text blurry on the UI ? i added my own font but when i go lower then 16 it gets blurrier

humble finch
#

nah i dont but i trough TMPro created many unessery files in my project i dont need. to mutch crap making the shit load slower

lime kindle
humble finch
#

yeah tmpro works kinda fine, but seems like it filling my project with enormous files

#

i want to keep everything clean, so there is no why to change my font to make it crispy?

#

.< damn this unity UI please unity update it

lime kindle
humble finch
#

so i should change inside the font to 150? then just scale every text in the canvas to lower?

lime kindle
#

yeah try that

#

if that doesn't work or it gets confusing, then just use TM Pro and accept that it has extra files.

Tip: You can delete TM Pro's "Examples" if you really don't want them

cerulean nymph
#

Hi there, looking if anyone has recommendation on what i might be missing to debug: working on a rts game, I have a panel that populates the unit icons for each unit selected, and that selection comes from a script to track mouse clicks etc. Now im trying to prevent moving if the mouse is clicked on a UI component but im having trouble. if I put a if(EventSystem.current.IsPointerOverGameObject()){return;} at the start of the selection update method, this seems to prevent clicking on any UI component/button instead of just preventing the one script from running and a debug.log says its returning true no matter where i click.

humble finch
#

thanks alynn i will try. to drunk now but maybe tomorrow

humble finch
#

Was thinking about the method Crow named, IsPointerOverGameObject, how can i see if its over my UI and i want to drop item if its not

#

any recommend some tips? just show the way and i do it

humble finch
#

just wanna detect if my mousepointer is over my ui, else i drop the item

#

How hard can it be?

#

just dunno where to start so if anyone is kind show me the way

cerulean nymph
#

the IsPointerOverGameObject() should work to detect if its over a UI element or not so something like might workif(Mouse.current.leftButton.wasPressedThisFrame && !EventSystem.current.IsPointerOverGameObject()){DropTheThing();}

quasi glacier
#

Does anyone know why my font is blurry? (Before telling me to google it I have and tried pretty much everything I could find to no avail.)

mild kernel
#

What component are you using?

lost lake
#

Hello, how can I use Text Mesh Pro Font creator to generate Japanese glyphs? I am trying to follow this tutorial https://learn.unity.com/tutorial/textmesh-pro-localization#5f433c30edbc2a0020942eb3
And Im stuck where it says I need to enter the numerical range of unicode values I wish to include. Question is what are the unicode values for all Japanese characters?
Thanks in Advance

Unity Learn

To ensure your content is accessible to a large audience, it’s essential to translate and localize text. TextMesh Pro makes this traditionally laborious task just a bit easier. In this tutorial you will learn how to do this task

quasi glacier
jagged monolith
quasi glacier
jagged monolith
oblique sun
#

Does anybody have any idea how to update an InputField's text representation (i.e. the subset of the overal string currently shown because it's centered around the caret)? I'm trying to make a "coding window" with line numbers, which is just another read-only inputfield next to the actual text. All other logic (getting the right line, caret position and what have you) seems correct, but try as I might I just can't update the text. I've tried any ForceThis and SetThat method or property I can find on Inputfield.

#

Example of what I'm trying to do and where it messes up. Note how it correctly adds linenumbers, but once we drop below the frame edge still get added but don't move up like the rest. I can verify the other numbers are correctly there because I can page through them manually just fine.

oblique sun
spice horizon
#

Hey there! I'm trying to use the SetBool() on an Animator in a UnityEvent inside of an EventTrigger component but i can't seem to find it, just SetTrigger(). Am i blind, or is the function missing?

mortal robin
#

UnityEvents don't allow you to call methods with two parameters

#

At least you can't set up those calls in the inspector

spice horizon
#

god damn, good call

#

thanks!

magic walrus
#

https://streamable.com/6vl1xx

in the bottom middle of the screen i have an item holder that moves away when the round starts, and im using onpointerenter and exit to set a bool mouseOverItem to true and false, and then the holder moves in and out depending on the bool. in the clip it works mostly fine as intended except if i very quickly enter and exit, then it will just stay isntead of going away like it should. does anyone have any suggestions for a better way to do this?

sudden mulch
#

Hey there! I need some help with setting up a scrollbar and scroll rect. Basically when I try to assign vertical scrollbar to scroll rect, it just fills the entire scrollbar area with scrollbar handle and generally doesn't work. I can post more info and screenshots if needed.
Thank you in advance! :D

rapid stream
#

Hello, I want to make a health bar like this

#

with the circle going down as the health goes down

#

but I cant get a circle slider

gusty ridge
#

hi, how can I make the children stretch with the parentΒΏ

mortal robin
#

just use a filled Image component

#

As long as you fill the "source image" field, you can set image type to Filled and fill method to Vertical

#

and adjust the fill amount as you wish

gusty ridge
#

@mortal robinI tried the gridlayout

#

it just rearrange them

#

so I lose my own arrange of the cells

mortal robin
gusty ridge
#

@mortal robinIm making a sudoku grid style

#

the grid container scales with the resolution, but the cells inside wont

mortal robin
gusty ridge
#

with the grid or the canvas holding all sceneΒΏ

#

I already use it on the root canvas

quasi glacier
#

Font Problem

misty kernel
#

So, uhh, I have a problem with the grid layout, it doesn't work on smaller screen sizes. What it looks like on fullscreen (1920x1080):

#

What it looks like in the smaller game window:

sterile wedge
misty kernel
#

Both axis set to preffered size, that also isn't the issue.

quasi glacier
#

does anyone know why my font is like this when zoomed in? This is the game window. It's sharp in the scene window.

#

I want it to be sharp since it's a pixel font but it's blurry

quaint cargo
#

Maybe change the generation method in TextMeshPro?

#

I currently have a problem with pixel perfect not working when checked in the editor.

#

In fact the whole Canvas GUI is messing up

#

and GUI not showing up at all in build

flat spade
#

^^
I think I have the same problem...
Scene // Game

#

The white background is the camera one, not an error

simple pewter
#

any ideia why the components are behind the background image?

sterile wedge
#

UI elements are sorted according to the hierarchy. Lower ones are on top

simple pewter
#

didnt know that

#

thankss

quaint cargo
#

Is there a recent fix for GUI using pixel perfect camera?

#

Can we say it's not worth using?

cosmic herald
#

am quickly following a brackeys tutorial for a pause menu and it seems the shadow effect isn't working for me

#

i am adding it on my text component but i see no visual changes

#

is it maybe because it's not compatible with textmeshpro?

cosmic herald
#

I found it, text mesh pro has it's own

rapid ferry
#

Hey guys! I’m working on a game but I am really struggling on making the menu UI match with the in game UI.

coral cape
#

What's the best approach to make a pannable UI canvas? E.g. Shader Graph/VFX Graph...

rapid ferry
deep snow
#

Hey, guys! I'm trying to build an inventory UI with dynamic buttons, but I'm stuck at the navigation... does anyone knows how can I navigate dynamic UI objects using keyboard/gamepad?

#

Since they don't exist before runtime, I cannot use the navigation component option

mortal robin
coral cape
#

How can I get a parent object to resize its size respectively to the children's content? E.g. if the child expand with more UI elements, how can I get the parent to reflect the new size boundary? ATM Content size fitter doesn't seem to work on the parent control (parent does not have Layout Groupping, but all of the children does)

sterile wedge
coral cape
quaint cargo
#

@rapid ferry that's remarkable and thanks buddy, I'll check it out.

quaint cargo
raven gale
#

Does anyone know a tutorial how to change a background color of a editor button?

sharp fractal
#

Guys how can I make the particles show above the UI in the game view, I've tried watching a tutorial but it was just confusing. If anyone could help it would be much appreciated.

novel dust
#

Is there a good place to get references for the latest UX interactions working best in game design?

reef cloud
#

so, why is there this slightly visible background on the letters while using text mesh pro?

uncut folio
#

Can i somehow have UI thats pixel-perfect (as in i have a loading bar with just 1 pixel width background edges) while keeping the resizing based on screen size?

uncut folio
rapid ferry
#

Hi, can someone tell me how can I use Adobe XD ui in unity?

winter notch
#

who can help me to scale my UI I am having a hard time even after watching video + I do not understand many thing. thanks to anybody who will help me

sweet current
#

hello everyone, what causes this strange effect with the UI elements 'trailing' behind?

#

I want to actually have the N pivot even further past the circle [higher up], and if I do then it just makes the effect worse

#

I wind up with 'copies' of the N 'trailing' around the circle as N rotates on the pivot

#

this is outside of any Camera view as the cam view ends here:

red latch
sweet current
#

solved the old issue. just had to change camera view so it would be 'in' it but now I'm having this issue. by the time X has rotated 180 degrees, X is here.. [white lines to illustrate where centre is]

#

when X is at 0 degrees, though..

#

how is this possible?!?!

copper ocean
#

Hey how can I add my 3d model in my normal ui

signal pelican
#

Hi. How can I resize a Panel with my cursor (by dragging)?

jagged monolith
#

In runtime or editor @signal pelican?

signal pelican
jagged monolith
#

Press T to activate the rect tool and then you get handles to drag @signal pelican

sharp fractal
#

guys how can i get particles behind ui so like on the canvas rather than in world space

coral cape
#

How can I find the UI element that I clicked on? My canvas is set to Screen Space, which means raycast can't "Detect" any object if it's not in world space. I am having issue where several of my UI element isn't receiving clicks, and some element does receive my click. It appears as if there's another invisible UI element blocking my mouse click.

Any chances I could debug on this?

warped moss
#

I have made an if statement for my hearts and i need a restart game function or end game function here

#

if (playerHealth <= 0)

#

{
// End the game
}

#

WHat do i add there so the scene starts over and all gameobjects come back?

coral cape
#

Be sure to include using UnityEngine.SceneManagement; somewhere at the top.

warped moss
#

Okay tysm, srry for typing it i n the wrong channel

coral cape
#

How can I adjust the drag ratio between the mouse/finger to the scroll rect's content? Currently in one of my scene, the Scroll Rect appears to be 25% slower than the drag received from user's mouse/touch. How can I fix this? I checked other scroll rect, and they appear to move 1:1 ratio.

bleak estuary
reef cloud
#

Alr, thanks

simple pewter
#

does anyone know a way to add caption to an image? I want the text to appear below the image when the player click a button to show the name of the image, but I dont really know how to do this

cloud lintel
#

What's the purpose of a nested canvas?

#

Does it provide benefits over just having a single canvas with panels as children?

cloud lintel
#

Thanks, so basically if there are a lot of dynamic elements, then the dynamic elements should be on it's own canvas to maximize performance.

autumn barn
#

I'm having problems with my UI

#

it shouldn't be off the screen like this

nocturne marsh
#

should probably fix that huh

autumn barn
#

this is what it looks like in Unity

#

It appears to be a problem with the camera changing scale in the build

autumn barn
#

instead of giving me a snarky answer

#

I could really use the help 😦

#

UPDATE: this only seems to be happening with the WebGL version as the windows version's ui is fine

autumn barn
#

Any one know????

simple pewter
#

did u try to use the anchors?

#

i had the same problem

simple pewter
#

is there any way to do this?

nocturne marsh
inland obsidian
cloud lintel
#

It would really be nice for when there are two Canvas' set to Screen Space Overlay which target different displays that they don't draw on top of each other in the scene view in editor. This is especially annoying when testing stuff in editor because event system can get undesired input from the wrong Canvas because the editor "thinks" there is only one display.

#

Even if two separate display editor game windows are open it doesn't make a difference. All the Canvas' just get the dimensions of the last clicked game window and they draw on top of each other in the scene view, which is not how you'd expect it to behave if it is supposed to be drawing to separate displays.

autumn barn
#

I did not mean to send it as a file but heres a video of what its doing

sterile wedge
autumn barn
shrewd socket
molten mantle
#

Using GUI.DrawTexture, having trouble getting a box-select texture to stretch correctly. If I don't use BorderWidth then the border stretches with the size of the box-select. If I do use border-width, then ONLY the border shows, it is clipping out the interior of the texture entirely

#

My expectation is that the interior fills to stretch, while the border only expands, while remaining 1 pixel thick

mortal robin
#

I don't think it does that

#

I think borderWidth just makes it draw only the border

molten mantle
#

I am unfamiliar with that term, but that sounds right

#

Indeed right now it's only drawing the border πŸ€”

mortal robin
#

I know this isn't relevant for you but this is what i mean by 9-slicing

molten mantle
#

Yeah that

#

Maybe that is relelvant lemme see if I can configure the sprite like that

#

Is there some way to set the GUI Style to do Slice style with the texture like that link describes?

#

Or is the 9Slicing stuff only available for Sprite Renderer? It seems... pretty relevant for UI stuff so I'm surely missing something

mortal robin
#

The GUI.DrawTexture stuff is the legacy IMGUI

#

which I don't believe has any 9 slicing support out of the box

molten mantle
#

Okay so I should be using this UGUI business instead, which does support 9 slicing?

rapid ferry
#

Cant manage to remove this white border around the TextMesh Pro dropdown list area... Any ideas on where it's located?

mortal robin
mortal robin
#

try turning gizmos off for a sec

rapid ferry
#

.... thank you

#

lol

fallow rock
#

So I have a main menu empty gameobject that is a child of the canvas(UI Manager) and I want the width and height of the main menu rect transform to always match the size of the canvas. How do I do that

#

I can set the size to match the canvas but once I change the aspect ratio it no longer has the same height and width

wanton shadow
#

Hey! I've got a little issue, when putting an asset in my sprite renderer's sprite box, the sprite scales weirdly, would you got any idea on how to fix that?

sterile wedge
#

Is this Image or SpriteRenderer?

signal pelican
#

Hi. I have a Panel which shows me sprite images, when I click on a buttons. I want a fade-in effect. I made it like this

#

Any ideas how to script that?

#

This is my button btw

low pike
#

tween the alpha of the image

devout sphinx
#

Hi, i'm using a coroutine to smoothly fade in some TMP_Text but the effect flickers and resets when i am resizing the window.
Is there something I can do to prevent this?

#

Originally it permanently messed up the text so at the end of the coroutine i simply apply the final color to it all, just to make sure

#
//Grab dialogue text properties
        dialogueText.ForceMeshUpdate(true);
        dialogueMesh = dialogueText.mesh;
        dialogueVertices = dialogueMesh.vertices;
        Color[] colors = dialogueMesh.colors;

        
        //Slide curve from negative index to end of text
        for(int x=-characterFadeSpan; x<dialogueText.textInfo.characterCount; x++) {

            //Iterate from current index til end of curve
            for(int y=x; y<x+characterFadeSpan; y++) {

                //If index is in valid range, modify characters
                if(y>=0 && y<dialogueText.textInfo.characterCount) {
                    //Grab character info
                    TMP_CharacterInfo c = dialogueText.textInfo.characterInfo[y];
                    int index = c.vertexIndex;

                    if(c.character != ' ') {
                        //Apply color to all 4 vertices (Each char is on a rectangle mesh)
                        colors[index].a += 1f/(float)characterFadeSpan;
                        colors[index+1].a += 1f/(float)characterFadeSpan;
                        colors[index+2].a += 1f/(float)characterFadeSpan;
                        colors[index+3].a += 1f/(float)characterFadeSpan;

                        //Apply color effect to vertices
                        dialogueMesh.vertices = dialogueVertices;
                        dialogueMesh.colors = colors;
                        dialogueText.canvasRenderer.SetMesh(dialogueMesh);
                    }
                }
            }
            yield return new WaitForSeconds(characterFadeInterval);
        }

        //When done, assign final color
        dialogueText.color = defaultDialogueColor;
#

This is within an ienumerator, you can see i call ForceMeshUpdate() once at the top

#

i set text color to transparent before this.

#

Once again the effect seems to work fine but resizing the window breaks it

signal pelican
azure flame
#

You can swap to a material copy and fade that instead.

#

Or use CanvasGroup, it has built-in fade function

devout sphinx
#

Per character, and control their vertices to make the text squeeze?

#

because i dont want to fade all the text at once, thats lazy

#

This is for scrolling dialogue

#

You can see in the middle of the code where i made comments

//Apply color effect to vertices

I'm updating the mesh

azure flame
#

If there's an event that reinitializes them on redraw when window resizes, you may need to hookup to same event and reset everything after.

devout sphinx
#

kk

#

Its not exactly gameplay breaking, and kind of rare since the player has to be resizing the window while text is populating

#

fortunately the end result pops up when it needs to, but it does flicker a bit

chilly lion
#

How do I make a field in my inspector to select a folder in Assets?