#📲┃ui-ux

1 messages · Page 2 of 1

low pike
#

the alpha on that colour is set to 0

tidal osprey
void solstice
#

trying to figure out a good way to do the menu tabs for this

I want to make this book into my pause menu, with tabs for equipment/stats, magic, map, and options

but I can't think of a good way to do the menu tabs. What I have here is my current iteration, but and those tabs in the bottom right are all fully extended (the unselected ones will be drawn more into the book pages)

but its not really ideal, because they are along the bottom edge of the screen, there is no more room down there

#

anyone got any ideas about this?

violet sandal
void solstice
#

im working on it a bit more

#

I want to give the book marks more detail and depth like in this second picture, but then there isn't really room for the icons. I can solve this thought by just have the leaflets on the side be the things that change, and notate which tabs are left and right

#

maybe make those side leaflets into bookmarks themselves, instead of bits of page sticking out

#

this way its clear what LB and RB will do, and I dont have to rely on icons packed into the bottom edge of the screen

gloomy zephyr
#

Hey, I started working on a UI for a game. I made a Particle Effect however, Whenever I Click play in Unity, It does not play it. Any ideas would be appreciated.

#

Please ping me on response. Thanks

low pike
#

It is playing, it's just off screen

#

You've positioned it up to where the UI is in the scene.

low pike
#

What's the best way to do 'inner shadow' on TMP text?

gloomy zephyr
tawny rivet
#

Hello guys! I'm building a ui interface for mobile and i need to force the UI in portrait mode, i can't force in portrait from project settings because i need also the landscape mode, is it possible to block the ui like the portrait mode in landscape? Thank you 🙂

low pike
#

is it possible to block the ui like the portrait mode in landscape?

This doesn't make sense

random ginkgo
#

How do I scale UI to the size of the screen?

#

Im using DOTween rn and im very happy with it

mortal robin
random ginkgo
mortal robin
#

plus anchoring your object properly

buoyant crescent
#

Hi, may canyone help me with an issue about building?
Thing is that I have UI buttons on the level which are clickable to restart level, open menu, etc
But when I build the game, the buttons are no longer clickable, any suggestion?

wary mauve
low pike
#

a resolution change wouldn't stop the event system working

buoyant crescent
#

Works fine on maximized

low pike
#

Use the device simulator for mobile games, not the game view

wary mauve
#

But it would change the size of the components if you set them up incorrectly. I helped a couple of guys figure it out when they changed the resolution in the game.

#

His banana texture covered the whole screen maximized

low pike
#

If they haven't got all the scales at 1,1,1 , I guess

wary mauve
#

The click part that is, the texture itself was still small

low pike
#

@buoyant crescent change to 'simulator'

buoyant crescent
#

Still works in simulator

low pike
#

Throw debug logs into your code when things should happen button press, and test on device with that so you can narrow down the problem

buoyant crescent
#

Okai, thanks I'll try to solve any debug problem

coarse grove
#

how do I change the size of a viewport without scaling the content?

storm pilot
#

I have a imgui UILabel, and I wanted to know how to calculate the width in pixels, so I can draw graphics at the end of the text

buoyant crescent
#

thanks for all your responses! ^^

rapid ferry
#

Idk if you solved this yet or not but using the canvas mode screenspace-Overlay makes the UI render on its own layer or whatever so it's not affected by the pixilation

weary flare
#

oh crap really?!!

sour geyser
#

I have a scoreboard that's supposed to show up when the player presses <tab>. Well the canvas for the scoreboard show's correctly but the child UI elements are off the screen. Do you know how I can make the child elements stay on the scoreboard? The scoreboard follows the camera, but I don't think the child UI elements that are made at runtime are following the camera, and the child UI elements position are outside the canvas.

wise elk
#

Can anyone name this text?

shadow fulcrum
#

Guys, I have a problem, my text in the canvas is too blurry, i want it to be hair sharp

mortal robin
shadow fulcrum
mortal robin
#

That's weird. 1 should be the default

#

I believe it's why you have blurriness

frail jewel
#

Why when you set a button to Interactable = false it stops all navigation on it?
im using a button like a toggle, and for gamepad, when its Selected and i click on it. I can't get off it since the Navigation struct, i guess is disabled too?

#

i can think of some work arounds, but none are ideal

sharp vessel
#

Hey, I have a world-space canvas in my game. My problem is that images and text mesh pro are visible from behind even though there's a panel behind these elements. Is there any way to fix this?

lost hazel
#

hey im makeing an android game but the ui scale is broken or something because when i try the game on difrent deavisces the ui scale is wack

mild kernel
#

It's "wack" because you didn't design your UI with a reference resolution set, which unfortunately for you, means redoing it all properly when it should have been done as you made it.

Choose a resolution (1080*1920 is common) and set you canvas reference resolution to that.

Change your game view to use this resolution too, not free aspect.

Position your UI and properly anchor them to the sides and corners where appropriate.

Change your game view resolution to different ones to test how the UI will change.

mild kernel
#

I mean ... if you had to guess at this moment, what do you think?

lost hazel
#

u might have been talking to the person above me 🤷‍♂️

mild kernel
#

Yes, because quoting the word "wack" is that common. 🙄

#

But yes I was responding to you.

lost hazel
#

ok thanks ill try it

#

it works for every phone apart from this one

#

the 2 small butttons are not showing

mild kernel
#

Anchor them to the bottom left corner

lost hazel
mild kernel
#

A little google time. It requires a visual aid that I can't provide on mobile.

lost hazel
#

ok

lost hazel
mild kernel
#

If it's not showing, then you might have made them not children of another rectTransform.

haughty drift
#

So i have positioned some elements in scene view yet when im in play mode they are a complete different location and i don no why?

#

prefab is upto date

mortal robin
#

Double click your canvas in the hierarchy

#

make sure gizmos are on

#

the big rectangle you see is the full size of your screen

#

lay out your UI elements as such

haughty drift
#

play mode they move to th etop

sharp vessel
#

Hi all, any ideas how I can make sure my world space UI isn’t rendering from the back too? Thanks

rough summit
# sharp vessel Hi all, any ideas how I can make sure my world space UI isn’t rendering from the...

https://forum.unity.com/threads/worldspace-canvas-backface-culling.310857/
Linked forum post is from 2016, with a Unity UI Dev stating that back-face culling on UI stuff is disabled by default, I couldn't immediately find a button to enable back-face culling on World Space Canvases in a Unity 2021 project so I assume the solution is still the same as in the forum post?
:/

digital orchid
#

hello, when in play mode (minimized) and in editor, this panel looks like this

#

but even with scale with screen size on, when i maximize it looks like this

#

ignoring the terrible sprites, what could i do to fix this?

low pike
#

anchored to the wrong place

#

They need to be children of the black background, and anchored to the top of it

digital orchid
#

does it have to be the black background?

#

(stuff is funky, it's a runtime level loader with funky stuff in it)

digital orchid
low pike
digital orchid
#

it worked thanks

digital orchid
violet sandal
#

hm. i think i fixed it by changing the spacing of the layout group by .1

urban copper
#

hi! I would like to ask for some indications for something I want to do in UI and I don't know how to approach it.

#

im trying to do a ui behaviour like some games, where the player can navigate and interact through the menus with only d-pad / arrows in this way

#

i draw my guess about how this kind of thing is made, but i dont really know

#

and there is no navigable panel, so i should do it myself or something?

gaunt yew
#

i have an inventory and want to sort button order by enum ItemTier. How can I change the button order? I don't think destroying all buttons and instantiating new ones when just 1 item is added to the inventory is a good idea..

#

i am using a gridlayout to store the buttons

gaunt yew
#

setsiblingindex did not work for me. Maybe unparenting and reparenting is a decent solution?

pulsar patio
#

Hello! I am using unity and wanted to edit this gray box so it perfectly fits the text is there anyway to do that?

#

Sorry I meant Unity 2021.3.6f1

#

I have added the button component to the text

exotic coyote
#

Hi, how can I make height and width of Horizontal layout group children the same? I want it to scale to keep 1:1 ratio

pulsar patio
#

Hello! I am using Unity 2021.3.6f1 and wanted to edit this gray box so it perfectly fits the text is there anyway to do that?
I have added the button component to the text

gaunt yew
low pike
pulsar patio
gaunt yew
#

i have an inventory and want to sort button order by enum ItemTier. How can I change the button order? I don't think destroying all buttons and instantiating new ones when just 1 item is added to the inventory is a good idea..
i am using a gridlayout to store the buttons

jagged monolith
#

A gridlayout will sort your buttons based on their order in the hierarchy. So just shuffle them around

grave surge
#

if I wanted to make tutorial text for a 2d platformer, would I need to stretch a canvas over the whole level?

mortal robin
grave surge
#

Would i need to make multiple screen space canvases?

mortal robin
#

why would you need to do that?

severe crescent
#

Good evening! Does anybody knows, is there a way to interact with UI via render texture?

mortal robin
#

a render texture is just an image

severe crescent
mortal robin
#

I have no idea what noesisGUI is

severe crescent
#

Well, noesisGUI is out of equation, I am wondering about something like this but using default unity UI

mortal robin
#

I'm not really sure what "like this" actually means though

severe crescent
#

Interacting with UI via render texture

exotic coyote
scarlet owl
#

how do I center this UI Canvas in my scene viewport?

frank osprey
#

Looks like the answer would be simple, if I understood the question correctly. Have you searched the internet before posting here?
It would just be tweaking the anchoring presets of whatever that image is, to center it horizontally

dapper quiver
#

How can I set the position of a gameobject on a canvas inside a script?

#

(in this case an image's position

#

I imported UnityEngine.UI but I don't have any options for changing RectTransform

dapper quiver
#

How should i explain this

#

so whenever something happens, I want an image get repositioned on a canvas

low pike
#

No, explain why you can't get RectTransform

dapper quiver
#

So my first idea was transform.position

low pike
#

it doesn't require the UI namespace

dapper quiver
low pike
#

what colour is your MonoBehaviour?

dapper quiver
#

if I try to type it in VS community says its unknown

dapper quiver
#

Everything else works fine

#

But I dont know how to set the position of it correctly on the canvas

low pike
#

.anchoredposition like I told ya

dapper quiver
#

that counts like posx and posy in the inspector?

low pike
#

once you figure out why RectTransform won't show up

low pike
dapper quiver
#

"gameObject does not contain a definition for RectTransform"

low pike
#

right, because it's not part of GameObject..

dapper quiver
#

even though the gameobject the script is attached to is the image

low pike
#

GameObject doesn't have a property of RectTransform

#

you can't do gameObject.rectTransform it's not a thing

dapper quiver
#

Ah right yeah

#

Makes sense

#

How can I call for that component then?

sterile wedge
low pike
#

Same way you would any other component

dapper quiver
#

gotta figure that out real quick

#

I know how to call for an object but thats not enough

sterile wedge
dapper quiver
#

Either SerializeField or FindObjectOfType<>()

sterile wedge
dapper quiver
#

......well shit

#

I 100% did but I never used it

sterile wedge
#

it's really basic

#

really? damn

#

that's like one of the basics of Unity

#

here. the very first video

dapper quiver
#

so just gameObject.GetComponent(RectTransform)?

sterile wedge
#

no. watch the vid

dapper quiver
#

first the video doesnt even start and I cant watch it

#

second, I looked up the documentary on it and it still just doesnt work cuz im being dumb

#

I swear to god I used this before in a different project

#

But I completely forgot

sterile wedge
dapper quiver
#

Wow.

#

I tried doing that

#

And now I have a whole different issue

#

That shouldnt even be related to this

#

What the hell

#

Nevermind.

#

Yep it works

#

Thanks for the help @sterile wedge and @low pike

#

sorry for the smoothbrain moment

hexed plank
#

What is the best approach regarding UI when developing a game that is designed for both PC and Mobile ?
Should I count on canvas scaling and some tricks here and there, or just have different canvases for PC & Mobile, with a device checker to enable the one or the other ?

sterile wedge
hexed plank
sterile wedge
#

Then make the different panel?

#

not sure what you mean

hexed plank
sterile wedge
hexed plank
sterile wedge
low pike
#

There are assets on the store for it

deft surge
#

Is there a way to stop this weird "highlighting" on TMP text?

#

it's pronounced at lower resolutions or smaller font sizes

sturdy shuttle
deft surge
#

Worked, thanks! 👍

candid meadow
#

Heya, Im currently having troubles controlling a canvas through rendered texture

#

It works but is completely not aligned with the camera viewing the texture

#

any ideas?

#

how it should be, use mouse to interact directly with the tv screen to control the menu

#

how it actually is right now: the menu is completely not in the right area but can be interacted with the mouse

stone pollen
#

what do I have to make, so the text field shows the newest text e.g. the bottom of the textbox and not the top of it?

main meteor
#

I have a minimap in the top left of the screen, and when resizing my canvas, the minimap zooms in and out. Does anyone know how I can keep this the same size when the canvas is rescaled?

mortal robin
#

use the "constant pixel size" mode on your canvas scaler

paper hill
inner dagger
#

Can TMPro handle tricolor vertical gradients? If I want the text to have a white center and a slightly darker top and bottom, can TMPro handle this? It seems I can only do this diagonally, with up to 4 colors at each vertex.

rustic warren
#

I have a Panel with HorizontalLayout component with two child Panel components. Both components take up 50% of the layout as expected. When I add something to one component, eg TMP_Text object, the width of that containing panel expands even though the TMP_Text does not exceed the parent Panel's width. How do I enforce width percentage constraints with UI components?

dapper quiver
#

Hey guys. So I am trying to use InputFields to save strings into different ScriptableObjects, but for whatever reason, each time I write into one of these InputFields, it just acts like I've written nothing.

public class GameResources : MonoBehaviour
{
    public DIReference ball;
    public DIReference leftSprite;
    public DIReference rightSprite;

    [SerializeField] GameObject menu;
    public void Back()
    {
        menu.gameObject.SetActive(true);
        gameObject.SetActive(false);
    }

    public void BallInput(string ballName)
    {
        ball.spriteName = ballName;
        Debug.Log(ballName);
        Debug.Log(ball.spriteName);
    }
    public void RightPlatformInput(string rSprite)
    {
        rightSprite.spriteName = rSprite;
        Debug.Log(rSprite);
        Debug.Log(rightSprite.spriteName);
    }
    public void LeftPlatformInput(string lSprite)
    {
        leftSprite.spriteName = lSprite;
        Debug.Log(lSprite);
        Debug.Log(leftSprite.spriteName);
    }

}
#

Somehow, it can detect whenever I type into one of those InputFields, it just doesn't change the strings.

#

Whenever I try to Log it, I just get nothing back

kindred bolt
#

Don’t think that’s how those works

#

See that empty space at On End Edit, right below “GaneResources.BallInput”

dapper quiver
#

what about it?

kindred bolt
#

If you have “Crow” there that’s what will change

#

That empty space is the parameter for BallInput()

dapper quiver
#

....but it didnt change there either

dapper quiver
#

I used the same code

kindred bolt
#

What did you do

#

Screen shot

dapper quiver
#

I used the exact same method to set it up the 1st time

#

and it worked perfectly

#

then I copied it twice

#

and then all 3 stopped working.

kindred bolt
#

Not sure then

dapper quiver
#

this makes no fucking sense

#

It can detect that I'm typing into it

#

it can detect when I finish typing

#

it just doesn't save the variable??

#

or completely ignores it?

quiet silo
#

maybe you are overwriting the string somewhere

dapper quiver
#

but where?

quiet silo
#

maybe ball / leftsprite / rightsprite are pointing to the same DIReference?

dapper quiver
#

I declared them separately

#

They are declared on a single gameobject in a single script

#

But everything seems to check out...

quiet silo
#

screenshot the GameResources object

dapper quiver
#

I mean ofc they are also declared on the gameobjects to which they are meant to send the string's value to

quiet silo
#

did you change onEndEdit event for each object?

stone pollen
# paper hill try using TMPro it gives you a lot more customization

but how to make, that the newest text ( the one on the bottom, is the last one visible in the textbox?
like hide everytghing on top of it.
I want that work like a Terminal, where your old text is not visible in the upper edge and you new wroten text is vissible on the bottom of your textfield.

dapper quiver
#

In which case Resources, cuz thats the one that holds the function

#

Oh my god.

#

I am so fucking dumb.

#

It was because I tried to use the functions with Static parameters...

#

And not dynamic

#

I just chose the function name at the bottom instead of at the top

#

Wow.

#

no bloody surprise that it cant log anything

#

I am trying to read a string instead of change it basically

quiet silo
#

are you talking about in the unity event dropdown? I don't use unity events so not too familiar with them

dapper quiver
#

Thats why there was a textbox

#

as you said

dapper quiver
#

It works.

#

I am very ashamed of the current state of my existence

quiet silo
#

oh.. I was confusing what you were doing and a problem I had recently where my editor input box kept getting overwritten

dapper quiver
#

I thought that I an overwriting the value of the input strings with the value of the DIReference strings each time (which is null)

#

but no, the syntax was correct

#

It was just me being dumb in the editor

#

ughhh that was so much time wasted

#

at least this makes up for it somewhat

#
  • no clue what happened to the size of the pedals but I honestly think its better this way lol *
paper hill
stone pollen
#

I already made something same with VIsual Studio Console Application... And I want to rebuild it with unity and multi threading.
The textfield should work same with the text output, like every else terminal, for example the Windows "CMD"

#

the old text is over the top corner and not visible and the new text is down somewhere.

stone pollen
#

and that is what I try to make in unity

paper hill
#

and you want the text to just type normally down?

stone pollen
#

but how can I make, that the lowest in the textbox is visible on the bottom of the canvas and everything else that doesent fit over it in the textfield, should be invisible.

stone pollen
stone pollen
stone pollen
candid meadow
fringe jay
#

Is there anyway to find free UI designs and UI Text that I can use for Prototyping games and for Portfolio games?

frigid cobalt
hollow karma
#

I have a load of buttons laid out in a grid. Each row is tied to one NPC. The parent object row stores a load of values which are shown in the individual buttons.

I'm trying to make a system where the player can navigate to an individual button with the arrow keys, and then press "<" or ">" to raise or lower the amount of resources on each button. I'm trying to figure out how to make it so that when < or > is pressed, it only changes the resources on one of the buttons.

Currently no matter which I have selected, pressing them changes the resources for all the buttons. Is there an easy way to script so that the function to change resources only runs on the currently selected button?

paper hill
stone pollen
# paper hill ohhhh. just add a line break `<br>`. I believe this is what you are looking for.

<br>?
in what context? I don't know your context how I should add this in the code? I mean I don't even know what it should do and self searching stuff like that doesn't help me:
https://forum.unity.com/threads/inputing-a-line-break-in-a-text-field-for-ui.319223/

stone pollen
#

//Why is it still not showing me the lowest character in the field at first?

    private void My_SinglethreadTask()
    {
        int MeineRandomZahl2 = Random.Range(0, 9);

        Text_tmp.text = Text_tmp.text + MeineRandomZahl2.ToString();
        Text_tmp.text = Text_tmp.text.Replace("<br>", "\n");
    }
stone pollen
frigid cobalt
flat ice
#

so when i make changes to the material, it changes all of the other textmeshpro text i have on my scene, how do i make it so that i can only change one instance of it?

#

like I just want the outline on reloading, not on Equipped.

low pike
#

It's because you changed the material which they all use

flat ice
frigid cobalt
low pike
flat ice
#

k thanks

lost lake
#

Hello, how to have a Toggle call different events for On and Off ?

bold raptor
#

Let me know if this isn't allowed.

#

I was wondering what you thought of the layout here, and I was also wondering what you thought of the readability of the text

#

And if you're up for it, I'd also love to know what sort of thoughts, feelings, or emotions you had looking at the whole picture

clear terrace
#

hello, I'm working with a UI, and I want to make an inventory with some 3D gems, I'm using URP and use a render feature, but I can't use masks to hide them if they come out of a grid. does anybody know how I can fix it?

mortal robin
lost lake
# mortal robin An if/else statement

right but then I need an intermediate script to have that if:

if (on) {
    OnEvent.Invoke();
} else {
    OffEvent.Invoke();
}

And I will need to add my events to this separate script and possibly will need to add it to every Toggle

#

Im looking for an elegant solution if it exists

analog jay
#

Spent Sunday working on extending TextMeshPro to add dropshadow and outline effect to bitmap font

tribal saddle
#

How can I put UI behind 3D objects in way I can still interact with the UI but with the 3D object in front of it?
I an game named Star citizen I saw some terminals made that way. I dont knwo how they did it, but is it doable in Unity?
One of those looks like this:

low pike
#

world space UI canvas, no collider on the 3d infront of it

tribal saddle
#

would that make the 3D objects appear in front of the UI

#

I want to achieve a glass effect over the UI

#

like in the image above

low pike
#

Yes, I understood what you wanted. And I gave you the solution

tribal saddle
#

so i only need to remove the collider on the glass object?

#

Thank you!

hot roost
#

Quick question; when you have a few different HUD elements (example score box, then a "Goal" popup that sometimes appears etc..). Is it better to have these under completely separate Canvas' or put them all in the same Canvas?

low pike
#

both ways have pros / cons

hot roost
#

So it's just up to me? There's not a "Best practice"?

low pike
#

If you've got a lot of UI going on, then multiple canvases is better

tribal saddle
# low pike world space UI canvas, no collider on the 3d infront of it

There is another problem. I can't interact with the Ui in world space even if i put it in front of everything. I was sure to lock the cursor in the center of the screen while in play mode and even looked in the Unity Manual, but there it said that once set up in world space it should work. What could be the problem?

storm wharf
#

Hey,

How can I make a scrollable rect for a TMPro if the structure goes like this:

Scroll
  Viewport
    Content
      Title
      Header
      Text Body(overflowing with a mask)

I want to scroll Content, but the Content has to be the size of its child elements(Text Body is overflowing beyond visible area)

#

This is the result

#

I'd like it to scroll properly(unrestricted allows for that, but it goes on forever)

#

Use Child Scale width/height doesn't do anything either

#

I found out that the text actual height is not larger than the parent container, it is just text overflowing.
So the parent container won't resize, because it doesn't know how much text there is to scroll through.

Any solutions to that?

low pike
#

content size fitter

storm wharf
#

I am using it, but it does nothing.

#

The problem seems to be that Text Body/header/title have total height of 1080, even if there is more text outside of that area.

#

The header/title have around ~200 height so a total of 1080

low pike
#

You didn't show the content size fitter in that screenshot

storm wharf
#

its in the parent object

#

together with vertical layout group

low pike
#

You shouldn't be able to change the height of this recttransform

#

layout group should control child size height, and content size fitter set to prefered for height

storm wharf
#

It kinda did something, but controlling child size breaks it a bit, I guess that I have to use Padding on the child element tmpro to make it look the same?

#

It basically reduced their height to the minimum needed to display the text.(squeezed it)

#

I have a problem now tho, the scroll rect starts in the center, instead at the top.

low pike
#

You can add padding/ spacing on the layout group

#

None of the changes we've spoken about would change the scroll rect alignment

storm wharf
#

Yeah I got that, I wanted to add padding for title/header/separately, but that is still possible without using layout group padding.

#

It only reduces their width/height to the minimum, so it removed white space which is fine, I can fix that with padding/margin probably.

#

How can I fix the rect scroll starting at the top?
Do I have to use a script?
At the end of the day, I am going to be loading text via a script so maybe that's a good idea.

#

Actually I spoke too soon, it is still not working as expected

low pike
#

change the pivot so it's at the top and aligned to the top

azure flame
#

Also if you are going to add text procedurally you may have to trigger update for elements manually, this might help if you run into problems. <#📲┃ui-ux message>

storm wharf
storm wharf
low pike
#

Doesn't need to be fixed with a script..

storm wharf
#

sure

low pike
#

That issue looks like you've got a massive empty rect at the top, and the text is outside of the content rect

storm wharf
#

I havent touched Unity in a long time so I forgot a lot, just wanted to do something simple and I am already stuck 😄

#

No rect above

#

and the empty area above is not clickable/scrollable so definitely dont want it 😄

#

I made it start at the top by moving the content to the top

low pike
#

scrollable content is only half the size of the background

storm wharf
#

but for some reason I have to make it -75 y to match it, since at 0 the title would be outside the view.

low pike
storm wharf
#

its the size of a background

low pike
#

I bet if you move/reisze this.. it'll be aligned correct

storm wharf
#

ok 1 sec

#

Right so this is what I Moved to make Prologue appear at the top

#

I moved it so it sticks to the top of the content area

#

this is at Y 0

#

so the scroll will start in the middle

#

But it works properly

#

so the issue now is to make it start at the top

#

Playing around with Pivot settings, but it doesnt seem to do anything for the Story Content object

low pike
#

The Value field on the scrollbar sets the start point

storm wharf
#

oh I dont even have scrollbar

#

just scroll rect and I can drag a mouse to scroll

low pike
#

Did you not do this?

storm wharf
#

no I added it by hand

#

Also adding scrollbar causes the whole thing to move to the side :c

#

alright I will follow this one and see if I can recreate it

storm wharf
#

1 more thing tho, I think its a bug

#

Horizontal scroll bar Value changes to some random numbers like 56 when I leave test mode

#

And Vertical changes back to 0.5

north smelt
#

guys
I need help with dropdown

#

I have settings menu with json data saving

#

at start of Settings Scene I want to make dropdown select options which is the same as option from json

#

example:
one of dropdowns selects screen resolution which I can save to json
when I enter settings scene, it must have the same screen resolution option as in json file

storm wharf
#

Content Size Fitter is the cause of the resetting values, trying to make it work without it

#

Alright works :<

storm wharf
#

in inspector

north smelt
#

tnx

storm wharf
#

content size fitter broke it, I just found some post on forums

#

this one 😄

#

ah

#

@north smelt sorry, I am not answering your question

north smelt
#

oh

#

k

north smelt
#

got another problem

#

but I must show it to you, gimme some minutes

#

after 2nd and more scene loading input field doesn't change string value

#

if this question should be in another text channel - warn about it pls

low pike
#
  • What does 'reload' do?
  • How is the input field connected to DataManager?
plain whale
#

I'm using Pixel Perfect Camera's "Upscale Render Texture" for my pixel art game. Is it possible to make this ignore certain UI texts? I'm using pixel fonts for the game, but unless I manually perfectly match the pixels of the font with the game it becomes unreadable and blurry. Is there a way of doing this that I'm missing?

analog jay
#

studying other games, especially those u like 😄

rapid ferry
#

Hitman games UI is amazing

flat nymph
#

how do I open a scene in a new tab? When I create a new scene tab and open a scene in it the other scene tab changes to that scene as well

low pike
flat nymph
low pike
#

I don't have any specifics, but udemy and educational places like that are gonna have UI/UX courses

north smelt
low pike
#

How is MenuManager connected to DataManager?

north smelt
#

wait a min

north smelt
#

I forgot that I can connect with DataManager by using Instance, not assigning to new object

#

I usually used to do this

mossy widget
#

Im having some very peculiar UI issues. The UI does not seem to update certain elements until the screen is updated via slightly resizing the menu.

This issue is also present when switching between scenes, a bit of the UI from the previous screen enters the background of the current screen untill I do the resize thing

#

Ive found online threads of ppl with the same issue, but seems like no one has the solution

#

Been stuck on this problem for nearly a week now

#

any idea?

chilly hemlock
mossy widget
#

Just updated fully yesterday

chilly hemlock
#

?

mossy widget
#

2021.3.9f1

chilly hemlock
#

Updated what?

#

Try a later one

mossy widget
#

Ight Ill do that

chilly hemlock
mossy widget
#

On the unity hub menu it says 2021.3.9f1 is the most recent LTS version

#

I assumed the 2022 was legacy

#

Thanks Though

chilly hemlock
#

Oh okay

chilly hemlock
#

If you go to the website you can get every released version ever.

mossy widget
#

Im jsut going to pick the most recent one on the hub just to be safe

#

so that is 2022.1.15f1

#

Damn I just updated and the issue is still there

#

Both these issues are present. The slight resizing always fixed them

modern vigil
#

how do you handle different screen size for UI design?
let's say that on a 1080 screen I have an icon with a size of 48px, on a 4k monitor it doesn't look good, and if I try to design for 4k it looks really bad on smaller screen.
For some things like buttons I can use the 9 slices but I don't understand how to nicely scale images.
anyone got a link to a good documentation/reference on that?

somber mortar
#

Hi I am working on a little clicker game and I am looking for someone that could make a few UI pictures/designs Please Reply or Dm if interested

storm wharf
#

If I want to be able to detect mouse clicks on an object, I need to make it a button?

mortal robin
#

You don't need to use a Button to detect clicks, no @storm wharf

#

you can use an EventTrigger and add the Pointer Click event, or you can add a script to the object that implements IPointerClickHandler

storm wharf
#

Thanks

sand wagon
#

Hye I have a question if I want to do a drag and drop object should I use 2d or UI image ? and if I need to use 2d(sprite) how do I make it responsive to every resolution ?

turbid crow
boreal mirage
#

i have a question, is it possible to get object on screenspace overlay?

sand wagon
fiery lava
#

any idea how i can add some text jsut on the wall or something in my scene? i dont want it to bu UI i want it to be actually in the scene

low pike
#

TMP under 3d

mossy widget
fleet kite
#

how do I render UI with a different camera if I have pixel perfect camera enabled?

azure tinsel
#

I am having a problem, I need to move the layer of an image that I am using as a toggle, but when I add canvas to move layer the toggle doesn't recognize me clicking on the image. What do I do?

sterile wedge
azure tinsel
weary flare
#

Having a discussion with my boss and he said scaling in Unity is not one click. As far as I know its literally a dropdown setting right?

sterile wedge
#

You're going to need to be more specific on what kind of scaling you mean

weary flare
#

eg: scale with screen size or not.

#

lock scaling or have the ui scale with the browser window/screen size

sterile wedge
#

Kind of sounds like a combination of the canvas scaler component and how the UI elements are anchored e.g. fixed size or set to stretch

weary flare
#

Our ui implemtation is a bit of a mess

#

Its react components and Unity

#

Needs to be just one

shrewd egret
#

My experience with UI/UX is in web-css and if I wanted this dropdown to be on top I'd change it's z-level, but I don't see anything like that here.

I know that I can move it lower in the hierarchy and it'd show up on top but then I'd run into the same problem with the ones on bottom, because it's a pixle-game I have limited area to work with so the drop downs on the second level will have to be "drop-up's" and open upwards.

#

Do I need to make multiple layers for the Ui?

shrewd egret
#

Tried multiple layers and it didn't work,
from googling it seems like it's just impossible to do any type of sorting besides hierarchical... Is this really true?

low pike
#

UI is drop from top to bottom.
Things that are higher in the hierachy are drawn first, so are at the back, lower are drawn last.. at the front

#

You can have multiple canvases, each with a sorting layer

#

probably put a canvas on each player panel, give them sorting orders

sturdy shuttle
#

my game is very UI heavy. right now my prototype is set up with roughly 15 canvases that are always active, and i control which UI is visible with Canvas Group alpha. Two questions regarding this

1- when the canvases are set to screen space overlay mode things are smooth, but when i use a UI camera the game grinds to a hault, going from 60fps to 10fps.

2- even if the alpha is 0, should i still be hiding my canvases when they're not needed for optimization reasons? (I leave them active so they can still listen to game events and update appropriately)

Anyone's insight would be greatly appreciated!

somber mortar
#

I am having this weird thing that I don't know how to fix so basically whenever I change some settings on one Text it changes it for the whole project. so basically if I change the outline it changes the outline of all the text in the project

sturdy shuttle
#

are you changing the outline in the textmeshpro shader?

#

or on an outline component with legacy text

somber mortar
#

TextMeshPro

nimble orbit
#

Anyone know what I can do to improve the quality of the text in the Terminal here?

It's really blurry and hard to read. I've read that TMP doesn't handle small font sizes well, but I don't want to increase the font size just for this to be readable.

#

The font is Fira Code 12pt

sturdy shuttle
#

if you duplicate the font material, it should show up in a material drop down on the textmeshpro component

nimble orbit
#

I'm really struggling with text qualitty with small font sizes. Since my game's UI is meant to be used like a fake desktop operating system, I can't just increase the font size of everything - because thinggs won't fit on screen

#

What can I do to optimize my TMP fonts for smaller font sizes?

sand wagon
#

Hey I have a problem where the canvas covering my sprite. How do I want to bring the sprite infront of the canvas ?

low pike
hollow karma
#

I'm trying to make a fake ascii frame for my canvases. What's a good tutorial on fine ui management?
I need to make sure that it aligns with the text in the canvas so it looks convincing.
I'm currently trying to use TMP buttons and layout elements but it feels a little messy with all the objects.

dreamy haven
# dreamy haven https://youtu.be/XLMt-ksvQSg

I made a health bar using screen long slider, unticked interactable, Transition: None, Navigation: None
And it was working exactly as I expected.
Then I added a pause function to the game, which doesn't manipulate the time scale but instead deactivates player and the enemies
And now when I click something while the game is paused, the slider lines with the Y axis of the mouse position.
what might be the reason for this behaviour?

#

this is the slider component

sturdy shuttle
low pike
#

It doesn't need occlusion culling or shadows

low pike
# dreamy haven https://youtu.be/XLMt-ksvQSg

That is odd. I've never used the slider for this, and to me.. it seems really odd to do it this way.

I would recommend using an Image, add a sprite (can just be a white square that's 2x2), change it to "filled" with the settings horizontal. Then you can change the fill amount between 0 and 1 (same as the slider)

[SerializeField] private Image healthBar;

float currentHealth = 100f;
float maxHealth = 100f;

public void TakeDamage(float damage)
{
  currentHealth -= damage;
  healthBar.fillAmount(currentHealth / maxHealth);
}
dreamy haven
# low pike That is odd. I've never used the slider for this, and to me.. it seems really od...

https://youtu.be/BLfNP4Sc_iA
I was following this tutorial which uses slider. Thanks for the advice, I will try that next time but still it is a curious behaviour and I would like to know if I am missing something or this is just a bug.

Let's create a simple health bar using the Unity UI-system!

Get up to 91% OFF yearly Hostinger Plans: https://hostinger.com/brackeys/
Code: "BRACKEYS"

● Brackeys Game Jam: https://itch.io/jam/brackeys-3

● Project Files: https://github.com/Brackeys/Health-Bar

···················································································...

▶ Play video
#

things would've been quite easy if this was a known bug

low pike
#

I don't rate brackey's highly, better than a lot of others.. but meh ¯_(ツ)_/¯

dreamy haven
#

it was the top result in my search I think

low pike
#

Doesn't always mean it's the best

dreamy haven
#

I would think that there was a widely accepted best method for something as common as a health bar and any half decent tutorial would show it

#

apparently that is not the case

#

that or bracket isn't even half decent

low pike
#

Beginners tutorials don't show the best way to do things

#

They show the easiest way to do something, whilst being able to understand it

somber mortar
#

This might sound dumb but how do I make a TMP material

sturdy shuttle
#

so i took Regular Title Material, duplicated it out a few times to create an outlined version, and a drop shadow version

#

then in the text mesh pro text component they'll show up in this drop down

#

sorry, the default material is a child of the SDF, so open that up and duplicate it from there

wise elk
#

Can anyone here make text? (create a .tff)

low pike
raven herald
#

when I test the game on my phone the the text look a bit blurry and so the other UI element how can i fix it?

raven herald
mild kernel
#

Are you actually testing it on the phone, or are you using remote?

low pike
tawdry aurora
#

how do you center text when the handles were moved around? rect pivot is already at 0.5

low pike
#

press T, use the UI tools

#

the yellow box is the TMP padding, not the rect transform

tawdry aurora
#

ok then what do i do with that to precisely center that padding thing?

#

and what's padding, like how do i turn that thing off to get UI text behavior?

sterile wedge
tawdry aurora
#

gotcha! thanks

#

what's the purpose of pading?

mild kernel
#

To make it not sit right on the edge

mossy widget
#

Im having some very peculiar UI issues. The UI does not seem to update certain elements until the screen is updated via slightly resizing the menu.

This issue is also present when switching between scenes, a bit of the UI from the previous screen enters the background of the current screen untill I do the resize thing
Ive found online threads of ppl with the same issue, but seems like no one has the solution
Been stuck on this problem for nearly a week now

#

Could I please get some help

low pike
#

a video of the problem will help

mossy widget
#

Sure

#

Can I DM it to you. Im Using unity for a research project and I dont want it to be public

cold plinth
#

watching a tutorial on UI, they're able to drag a rect using little point handles in the inspector (handles at each corner of the rect)
I don't see these, how can I enable them?

mossy widget
#

Found the issue after. The issue occures if there is a region where there are not cameras present

low pike
#

That looks like the camera region has changed size, and the previous frame hasn't been cleared

cold plinth
low pike
#

QWERT swap between tools

cold plinth
#

any good tutorials on how unity ui should be laid out?
Like right now I don't know if I should always have rect -> image -> children
or if I can gave just image -> children
yeah idk I'm totally new to UI I can't stand it

ionic beacon
#

Looks like the scale slider is not at 1x

sly elk
ionic beacon
#

There's a number just to the right side of it which needs to be x1

sly elk
#

but its soo small

#

thanks alot

cold plinth
#

how do I make a grid view thing for UI?
Apparently the built in grid group is really bad, idk why that's just what I heard
But I wanna make something where it places as many items as it can horizontally (without stretching), and then lets you scroll down

low pike
#

The included grid layout is ok. But the cell size is fixed, if the grid area changes in size, the cells stay the same.

You either need to use horizontal + vertical layout groups nested... or write your own grid layout... or buy one from the store

tardy palm
#

If I want to learn more intermediate/advanced UGUI (canvas), does anyone have good resources on it? Detailed dev blogs or forum posts would be great

For example I would love to know how the pros do animations, shaders/materials, layered effects and scaling in the UI. It feels like if I try doing it myself there will be a million ways to subtly screw myself.

Kind of stuck in search hell and can't break past baby's first canvas button tutorials.

trail lion
#

I created this prefab, and I want to put it in a vertical layout group

#

but this is what happenes

#

I don't understand

rigid kelp
mild kernel
#

Change the image type to filled on the bar.

spice horizon
#

hey! is there any way to select an input field via code?

#

i'd like to select my chatbox when you press Enter

torn grove
# spice horizon i'd like to select my chatbox when you press Enter

Something like this:

using UnityEngine;
using UnityEngine.UI;

public class MyClass : MonoBehaviour
{
    [SerializeField] private InputField _inputField;

    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Return))
            _inputField.Select();
    }
}

Note that:
• KeyCode.Return is "Enter"
• InputField is derived from the Selectable class, just like Button, Dropdown, Toggle, etc. So you can assign navigations, call Select() on it, etc, just the same!
• When you select the InputField, you will deselect whatever Selectable was selected before. In terms of navigation, you can only have 1 selectable selected at any one time.

spice horizon
#

hoho tysm for the quick answer! i didn't know it was this simple

frigid cobalt
# trail lion but this is what happenes

Yeah, the Unity UI can be quite annoying as parent items can often have an effect on child elements. You might want to start by adding a horizontal-group component to the PlayerListItem prefab and see if that helps.

nimble orbit
#

Is there anything like ILayoutElement that can notify me to recalculate my own layout based on the space available in my layout element's parent?

#

I'm writing a vt100 emulator and I need to calculate the amount of rows and columns supported by the terminal based on the actual width/height of the UI element it's rendered in

#

And I want to make it so that it can respond to resizing properly

#

...so if the terminal is currently 800x600 units but its parent decides to scale down to 640x480, the terminal should resize.

compact needle
#

I dont know if this belongs here but i'm getting crazy trying to figure why my input field (TMP) clears the content when i press back button on mobile (i already uncheck the "Restore on ESC Key" in case that counts as "ESC" but it stills clears the content)

bold raptor
#

Could you possibly screen record what you mean @compact needle Im a little confused

#

Could I have some opinions on this UI? Colors, design, or anything 🙂

compact needle
#

as you can see, the content of the input field only stays if i press the confirm button

#

if i edit the input field and press the android back button, it cancels whatever i did in it

low pike
#

Just checked our app, does the same thing

#

Never had a single person complain about it

compact needle
#

wow

low pike
#

it's a cancel input action, it's not a confirm input action

compact needle
#

maybe it's me that i'm so used to leave an input field with android back button...

#

but that didnt happen to me in any app

#

i mean, sure there apps that happens the same, but it's not what i usually see...

#

should i just let it like this? my muscle memory just press it again and again

low pike
#

I only use Android for dev, and never even thought about using back to dismiss the keyboard

#

Depends how big of an issue it is for you?

Is your game full of inputfields? Is there a lot of typing in them? -> try to fix.
Is there very few inputfields which you barely interact with? -> ignore and move onto something more important.

compact needle
#

thank you for your response, i'll think about that 😅

trail trail
#

So I'm trying to setup input controls for keyboard/mouse and controller for my game. I'm currently struggling with "Selected" events I suppose?

So right now I have my main menu setup so that it is "Explicit" navigation instead of automatic. This works great.

However, the problem I'm having is that when I open up a submenu, it doesn't automatically have a "First selected" in that sub menu. I could however, code this, but I'm just overall feeling that its a bit clunky to setup via code.

Is there something I'm missing?

#

I'd also really like it to easily pick "First Selected" or not depending on if its mouse or controller driven, but again, doesn't seem like theres an easy solution to that.

mortal robin
trail trail
rancid skiff
#

is there a way to deselect a buttopn through code ?

rancid skiff
#

thx

sharp oracle
#

Having a weird issue with TMP Dropdowns. It seems the box that pops up when you click on them is invisible in a camera-space canvas. I can see it in the editor exactly where it should be, and if I switch the UI Camera to Screen Space - Overlay, it works normally. But I need the canvas to be Screen Space - Camera in order to work with some other aspect ratio adjusting code I have.

How can I get my TMP Dropdowns to appear on Camera space canvases?

#

Okay, so, it seems like it's actually the camera stack that is the issue. I can set the canvas to be a camera-space canvas for the main camera and it works, except it can then be covered up by meshes in the world. Making it a second overlay camera in the camera stack prevents the clipping, but also means the dropdown is invisible.

sharp oracle
#

Ah, found it. The Template object that the dropdown clones to make the menu was not on the UI layer, so my overlay camera was culling it. Whenever I had the canvas to overlay, it was being seen by the main camera, instead of the UI camera. Resolved.

#

Thanks for the assistance

timber wind
#

Im trying to make a build for my project to make sure everything is working in a build so far. but some of the ui isn't appearing in the build version of the game and i cant find out why. I circled the ui that is not showing up in blue and have tried building the project like 3 times.

somber mortar
#

How do I scale the UI good I find that unity automatic scaling is very bad on big screens the text looks like an ant and on smaller screens you can only see one letter

fleet kite
#

How do I make TextMeshPro invert color from white to black depending on what's behind it?

mortal robin
low pike
dusty tree
#

sorry my bad

shadow fulcrum
somber mortar
old girder
#

hi guys, how would one go about making a filling bar similar to diablo's HP glass sphere that moves up or down with HP changes?
i got the glass and background images but idk how to make the "liquid", even faking it is good for me

somber mortar
mortal robin
vast furnace
#

okay so im creating an options menu, and it has a scroll rect. However, when I use the volume slider it scrolls the window and it's pretty annoying
does anyone know how to disable scrolling unless you use the scrollbar or your scrollwheel?

sterile wedge
vast furnace
#

ty

#

but ive made my own scroll script by now so yeah

#

thanks for the help anyway! 😄

old girder
#

does unity have the ability to use blending modes like photoshop to determine an image's alpha?

#

i want to fade in a certain image but just using opacity settings would be pretty boring compared to an effect that blending modes would create

low pike
#

I reckon you'd have to do it with a shader

wise haven
#

hey everyone, i have a question regarding button. how do i make it so that after i click a button then click another one, the last one that i clicked reset its scale and color to default? thanks in advance

frigid cobalt
wise haven
#

will try

abstract stream
#

Hello all, just want to ask a super simple question: what is this element called?

I've been calling it "carousel UI element" internally, but an internet search turned up a different (though somewhat related) UI element. I might want to release this as a free asset so I'd like to be sure I'm not messing up my terminologies. Thank you!

rare carbon
#

Hey, I have many performances issues with my game, when I look at the profiler in deep profile mode for the standalone I see that GraphicRaycaster.RaycastAll is very expensive.
I have only one or two canvas in my scene with a graphic raycaster component, and I have unticked all the unecessary "raycast target" toggles on my UI components, any idea how I can optimize my game or have more information about what is causing this ?
(above is a screenshot of my profiler, the blue part is corresponding to the moments where I have my cursor on my game, and the right part (good performances) is corresponding to the moments where I have the cursor on my second screen for example (but the focus is still on my app)
Thanks a lot

low pike
#

Looks like the same blue for animation?

rare carbon
odd falcon
#

Hello everyone I am wondering if someone can help me. I have a canvas UI with button tabs, however, I can not press these buttons. (e.g not executing script). I am able to sort of getting to work via setting one of the button tab gameobjects to be the "First Selected" property of the EventSystem, however this only allows me to select one option.

The first screenshot below is the hierarchy of the UI and as you can see I do have an Icon and a gameobject as children of the button (StatsTab/BackpackTab etc). If I disable these it does not work.

In my scene I do have another UI canvas that does work, but this one does not. The second image is the contents of a tab gameobject.

If anyone can help me, that would be great

low pike
#

probably something blocking the buttons

odd falcon
#

I am thinking that too. However in scene view, if I click from a different gameobject to the button tab it selects the tab (albeit after disabling my dialogue canvas), however this does not solve anything

low pike
#

..so.. the dialogue canvas is in the way..?

odd falcon
#

it was, but even after disabling the dialogue canvas game object, I still can not interact with the button

low pike
odd falcon
#

hmm, okay, the raycasts aren't hitting then cause I dont see a change in the EventSystem viewer

low pike
#

click in the game view first, make sure it has focus

odd falcon
#

i have

#

the the selected part of the event system view just sticks at "Selected: " even after me spamming so I presume that the raycasts just arent hitting

low pike
#

at some point in the hierarchy the raycasts are disabled

odd falcon
#

lemme have a look

#

I have looked and they all seem to be enabled

odd falcon
#

the only gameobjects which wasnt were the icon images but they are now raycasts but the raycasts still arent hitting

raw stratus
rare carbon
#

Hey, I have many performances issues with my game, when I look at the profiler in deep profile mode for the standalone I see that GraphicRaycaster.RaycastAll is very expensive.
I have only one or two canvas in my scene with a graphic raycaster component, and I have unticked all the unecessary "raycast target" toggles on my UI components, any idea how I can optimize my game or have more information about what is causing this ?
(above is a screenshot of my profiler, the blue part is corresponding to the moments where I have my cursor on my game, and the right part (good performances) is corresponding to the moments where I have the cursor on my second screen for example (but the focus is still on my app)
Thanks a lot

low pike
#

please delete from here and post there

lost lake
#

Hello, I just noticed in a recent update on Unity 2021 there can only be 1 raycast target element in a given Button hierarchy or else the raycast would get immediately blocked thus OnHover events wont stay like in this example:

#

That was not the case before but I cannot find any info about this

#

Is anybody else experiencing the same thing or anybody knows how exactly this is supposed to work?

low pike
#

Had weird issues like that in versions before 2021, I've only been having 1 raycast target on interactable elements for a long time

tropic comet
#

how do i fix the gray background on the text far away frrom me
Image

hallow sigil
#

I wonder why my clean png file doesn’t change to correct quality in gameplay?
I have watched YT showing what I need for settings and it slightly improved but still pixelated.
Using “raw image”

odd falcon
outer siren
#

Trying to choose between uGUI and UI Toolkit for a new, solo project. I'm no artist and I'm new to uGUI but my experience in frontend might make it easier for me to work with UI Toolkit (and easier for me to style them and make quick UI controls that look good rather than make a bunch of image assets). Which one to choose?

green arch
#

for some reason my canvas disappears when I click on any other gameobject or it's children.
it reappears when I click on the canvas gameobject itself:

green kettle
#

How can the Image not be effected by the Grid Layout Group

#

Is there a way to do this?

#

I want the Image to be adjusted based on the size of its Children commonly used on Tooltip systems

#

But it looks like its prioritizing the Cell Size of the grid layout group rather then its Content Size fitter

sterile wedge
rapid ferry
#

my UI object with a collider does not detect OnMouseEnter and I have no idea what could be causing it

sterile wedge
mortal robin
mortal robin
mortal robin
#

and what other components are on this object?

#

do you have an event system in the scene>?

#

Is there a graphic raycaster on the canvas?

rapid ferry
mortal robin
#

try experimentally disabling all the other UI until it works

rapid ferry
#

I have disabled every single gameobject in the scene

#

and it still does not work

#

could the problem be that the object is under the content of a scroll rect?

#

i have no idea what this is anymore

mortal robin
mortal robin
rapid ferry
#

I'll check if it does

#

okay no im stumped

#

i give up for today

blissful acorn
#

hello - im not sure what category this should fall under, however i'm trying to make a ui like the one shown in the attached mockup, I was just wondering if anyone had any helpful tutorials or such for this type of menu! i'm a bit new to ui design so anything that helped you guys would probably be helpful for me, thank you!

gilded quest
#

Anybody know if there's a way to make UI rects snap to grid?

#

Would be handy.

swift flax
#

I have several UI images/buttons that I want to be set inactive at runtime but I don't want to have to reference each individual one in code to set them inactive, is there a property I'm not seeing?

frigid cobalt
swift flax
#

I considered this method but the GetComponentsInChildren returns all children and the parent

mortal robin
#

or just deactivate a parent object, which will automatically deactivate all of its children

swift flax
#

oh panels

#

perfect

#

thanks

mortal robin
blissful acorn
# mortal robin Use GridLayoutGroup

thank you! any tips on how I could implement a container up top that holds the content from the buttons or is that a question for somewhere else

mortal robin
#

not really sure what you mean by "the content from the buttons".

blissful acorn
#

the buttons will have text on them, i essentially want a copy of the text from the button to show up in the list 🙂

mortal robin
#

the top part would just be a HorizontalLayoutGroup then

#

and you just instantiate prefabs into it as buttons are pressed

blissful acorn
#

thank you very much!

mighty bane
#

so i am making a vr game but the thing i am trying to do is make it so that when the button in the canvas is pressed the player teleports to the next part of the game

mortal robin
mighty bane
#

so i have the button and interaction but when i click it nothing happens because well idk how to make it so i teleport

mortal robin
#

you'd have to define what teleporting means

#

loading a new scene?

#

or just moving your player to a different location

mighty bane
#

moving the player to another location

#

can you help me?

mighty bane
#

nvm

#

i am dumb

mighty bane
#

I did it

slender zenith
#

I want to make a big skill tree like PoE's.
I've already all the logic and data/parsing handled, all that's left is the actual UI part.
How do I do it with Unity's UI without destroying my performance?
I need to be able to zoom in/out, and will have hundreds of nodes interconnected to each other. Most nodes have unique arts so if I go the naive way that will be hundreds of different images being updated whenever I move around in the skill tree.
Any advices? Thanks in advance.

warped oyster
#

hi, so i have post processing applied to ui, and it distorts buttons to the point where the button visually is and where you can click the button is different, is there any way to fix this?

night dove
#

anyone have thoughts on best practices for limiting player input to specific windows/panels?

#

I'm considering a manager script that lets you cycle between canvas groups, forcing all except the "focused" one to be uninteractable

nimble moat
chrome rivet
#

Anyone know why a single UI Mask is dropping my FPS from ~500 to below 100? sorry if this is the wrong channel

chrome rivet
#

Hmm, turns out it runs fine in Build and was just an Editor issue. Can't figure out why but whatever...

slow turret
#

Hey.
I'm currently building a settings menu and now want to implement keyboard / controller navigation.
To navigate between the settings I enabled vertical navigation for each setting-container and disabled navigation for the child controls.
Now when a container is selected, I want any input to be delegated to the child control.

Example: Like in the screen shot, the Textures setting is selected. When I now press left or right on the keyboard / controller, I want to control the inner slider controller.

Is this possible without additional scripting or am I maybe misunderstanding UI navigation?

mortal robin
#

but that's not navigation

#

the up/down stuff is navigation

slow turret
#

Unity would allow me to change the values by keyboard if I could select the slider or navigate to the slider. Since I disabled navigation to the slider, it doesn't work anymore.

amber void
#

Hey, I don't know how to go about implementing this desired behaviour. I have an inventory window that will pop open, but it will have a dynamic number of item slot entries. Instead of making 1000 different container windows each with different sizes I want this one to resize itself appropriately to a maximum size, whereupon it will use its scroll view/rect to show the rest of the container's contents.

#

So far I have a working scrollview and rect, but it looks wrong when it has less than the max window size. I want it to resize the window to fit only the number of itemslots.

mortal robin
#

You can have the slider's selection transition graphic be the row panel if you wish

slow turret
#

Ah, that's smart. I'll try that, thanks :)

sly tulip
#

is there a way to make a background image scale with the size of a grid?

#

so as more things are added to the grid, the background image will keep growing with it

#

answer is: content size fitter

cursive moon
#

hmm... why could my vertical layout group not account for the height of the child objects?

#

the only offset is the spacing value

cursive moon
#

hmm okay my problem is something else actually...

#

it's because the wrapper on the child objects have a size of 0

#

is there a way to tell the wrapper to be the same size as its content?

#

ohhhh, i was missing a layout group on the child object

chilly sorrel
#

Hey I need to create a menu that allows arrow keys as navigation and 'return' as an button interaction key

Does anyone know a good guide to this? I already have the buttons and what they are supposed to do. I just need that navigation

mortal robin
#

Just using automatic navigation should get you there.

green arch
#

Does this look good for a Main Menu UI?

gray garnet
green arch
#

I will try changing them all to the one I use at the top

ocean steeple
#

was watching Brackey and i notice he have this Example game file that show the window of his game instead of his scene, how do u do this in unity ?

mortal robin
#

Not sure what you mean

ocean steeple
mortal robin
ocean steeple
mortal robin
#

please be more clear

ocean steeple
mortal robin
#

what is "the health bar"?

#

what about the health bar?

ocean steeple
mortal robin
#

You have to realize that I have absolutely no context as to what you're asking about

#

Please come up with a clear question with context so that people can understand what you are asking about.

ocean steeple
mortal robin
#

like you want it to follow the player?

ocean steeple
mortal robin
ocean steeple
#

or at least make it visible when i play test my game

mortal robin
#

it will be there

#

position it properly that's all

ocean steeple
mortal robin
ocean steeple
mortal robin
#

double click the Canvas

#

you will see the whole canvas

#

position it where you want on the screen

#

middle of the canvas is middle of the screen

ocean steeple
#

oh ok it finally works now

#

thank you so much man

soft wave
#

Anyone know if it’s possible to make a child that masks it’s parent?

sterile wedge
soft wave
#

I have

  • parent which I want masked
    • mask which I need to move and I want it to move independently of parent and mask it obviously
    • other children of parent
sterile wedge
green arch
#

Is TMP_InputField.OnChangeEvent the right event for collecting information after editing a tmp input field?

unkempt echo
#

When I add a UI element to my canvas on runtime it isn't showing up, what can I do to fix this?

#

Never mind

#

It was an issue with another script that was causing it

#

It was a networking script that for some reason blocked the UI from showing when it failed

mighty bane
#

i am making a settings menu and have the drop down for Graphics but with my script i am using it doesn't change the graphics with the drop down and idk the problem i have it on on value change and i chose the right part of the script but it still wont change anything

fading fractal
#

Can anyone please explain me why the "content" of "Scroll Rect" is visible outside of scroll rect. For example the right eye in the image above (selected gameobject is scroll rect).

mortal robin
#

ScrollRect comes with a mask

#

you probably just need to adjust the one you have

rapid ferry
#

I'd use a rect mask here

sleek cipher
#

Is there a way on unity UI to do a sprite segment repeat? Like slice sprite into three parts with middle part being repeatable on UI?

sleek cipher
#

thanks

vocal reef
#

Anyone ever have issues with the rotation of an image affecting how it's filled when using Radial 360 fill method? In editor it works perfectly, but in play mode it seems like rotating the image causes the fill origin to change suddenly.

mortal robin
#

seems like a bug if you're seeing different behavior in edit mode and play mode though

vocal reef
# mortal robin seems like a bug if you're seeing different behavior in edit mode and play mode ...

I have fill origin set to right. If I rotate the object in edit mode, the fill origin rotates with the object as expected. Locally its still pointing to its right, but globally, its pointing in some other direction that I've set due to rotation. That's all good. In play mode though, for some reason at some angles the fill will jump to a different position and appear more like its fill origin is bottom or something.

vocal reef
#

Damn any ideas for how I can work around it? I tried rotating the parent object but same issue.

mortal robin
vocal reef
mortal robin
vocal reef
#

I was trying to remember if there were any, because I feel like I must have chosen to use scale for a reason.

#

What are the pitfalls?

mortal robin
#

One being that there's no indication from the Transform that the object is facing the other direction. So facing needs to be separately accounted for for any Raycasts or directional things etc being emitted from the object

magic walrus
#

i lowered the Plane Distance on the canvas and that seems to fix it, but i dont really understand why, just got lucky fiddling with things

cold glacier
#

any idea why only half of the button responds to clicks, the other half does not? Any ideas on this?

magic walrus
cold glacier
magic walrus
mortal robin
#

If you're doing camera stacking then IDK what the issue is

somber mortar
#

quick question how do you adjust your mobile app for landscape and portrait

vital linden
#

I'm trying to create a gui where there is an interface around the border of the whole screen and in the center will be more guis I'd like to display. Any idea of how to go about doing this? I'm using two canvas atm and they're just stacking ontop of each other trying to consume the whole screen

sturdy shuttle
#

what reasons should
CanvasRenderer.cullTransparentMesh
ever not be checked on?

#

is it exchanging a GPU hit for a CPU hit?

vital linden
#

im so confused as how do canvas work, seems like they just overlay my entire screen, i can't shrink them or anytihng

mortal robin
#

There's no need to shrink the canvas itself

vital linden
#

I donno, did game design before, even web design. You usually have a bunch of boxes to create a ordered layout. In here, seems like it doesn't conform to that at all.

errant creek
#

so im trying to use an image/sprite as a health bar but i need to set its draw mode to fill, the issue is i cant get the FILL option to appear no matter what i do, i did it once on accident but then unity crashed and i need to redo it and im going crazy trying to figure it out

mortal robin
#

if there is no sprite, the option won't appear

errant creek
mortal robin
#

you have to set the sprite there

errant creek
errant creek
mortal robin
#

wait also

#

why are you using a SpriteRenderer?

#

If this is UI it's supposed to be an Image

errant creek
mortal robin
errant creek
#

image seems to fix my issue thank you!

somber mortar
#

quick question how do you adjust your mobile app for landscape and portrait

brisk sandal
#

I have a GUI window object with a layout group and a content size fitter, that starts off disabled. But when I enable it it's not aligned properly, the object is too small and everything is crammed together. But when I close or re-open the window (or manually disable/re-enable the layout group or content size fitter) that fixes it. Any of you guys know what's happening here and what a good way is to fix it?

I tried running Canvas.ForceUpdateCanvases() when the window is set active, but that didn't help. I can't imagine disabling/re-enabling the layout group and content size fitter in the same function would help either, and it would also mean having to add extra references. Or perhaps I could add a UnityEvent and assign enabled = whatever calls to them in the Inspector.

brisk sandal
brisk sandal
patent cargo
#

I'm having a issue with my UI. I have set the Canvas to scale with screen size then created panels for the different areas of the UI.
However when the screen size changes all the UI elements are out of place. What can I do to fix this?

tardy shore
#

Hello so me and some classmates are working on a game project in Unity that is somewhat similar to Defcon/Hearts of Iron IV. I'm currently working on the UI since we need it to display some information about the nation (ideologies, goverment etc). I'm also wondering how I could make the button deselect-able by just clicking anywhere except the UI.

I appreciate any help, thanks!

somber mortar
brisk sandal
mortal robin
tardy shore
somber mortar
uncut cape
#

Question: looking at TextMeshPro richtext, is there a known way to accomplish something like "mark" tag that highlights words but eitehr a) underlays or b) has rounded corners. I'd like to have a section that has a rounded capsule around it

honest belfry
#

I have a dropdown and i cannot for the life of me get it to open downwards, it always expands above the dropdown... any help?

#

template shows fine

#

but in game opens upwards

pliant viper
#

edit: ty my custom script didnt work but content size fitter worked :D

rustic moat
rustic moat
# honest belfry template shows fine

I've experimented on this and it is cause by the height of our window. The template of our dropdown has limits on the height of our window, so if its within the range it will normally display downward.

honest belfry
rustic moat
#

the rect transform changes to top-stretch

rustic moat
honest belfry
brisk sandal
#

@somber mortar e.g. check the screen's current resolution, and if the width is less than the height that means it's vertical

wanton quiver
#

following a tutorial atm to set up a slider serving as a healthbar.
its telling me to set up the SliderCanvas like this (screenshot 1), looks ok.
But then it tells me to turn it into a prefab and attach it to the game object it'll be the health bar of (in this case, the dog). (screenshot 2)
Now it's all the way in Narnia, completely the wrong size (despite the dimensions seemingly being the same as in the Prefab) and just overall a complete headache. What am I missing?

This is what I'm following:
https://connect-prd-cdn.unity.com/20210505/70ffeabd-706f-4556-b9a9-ea6bd8ba631a/Unit 2 - Bonus Features Solutions.pdf?_ga=2.263578828.1186801097.1620052249-59568313.1601905412

Page 25, Steps 1 - 11

#

of note thats not apparent on first glance:
on screenshot 2, the healthbar in the game view is not the big one in the scene view, but rather the same one from screenshot 1

#

the really frustrating part is that im following these steps, redoing them several times in case i missed something, and the end result just looks nothing like what it says it should.

#

but between the solutions being wrong and me just doing something wrong, theres an infinitely greater chance that im just doing something wrong, but i dont get it.

wanton quiver
#

turns out the tutorial completely neglected to mention that the animals are scaled.
found this:

If anyone runs into the issue where the sliders become gigantic or minuscule after adding them to the animals, it's because the animals are scaled, and the slider, being a child of the animal, is in turn affected by animal scaling. What I did is divide the slider scale values by the corresponding animal scale values to end up with the original design. Hope that helps!

wanton zodiac
#

Does anyone know how to always have a UI object x pixels from a corner/border?

cerulean spoke
#

can anyone help me i tried to make my self a scroll view with buttons it kind of except for the content in the viewport. the Content teleports to a random point on the canvas after starting and closing the game
I didn't started coding yet

mortal robin
olive lintel
#

im making platformer game, and I want to make a background that has square pixels

#

how would I do that with ui?

#

do I need to make it a scale with screen thing

#

I want the canvas to be set

mortal robin
#

it has nothing to do with building the UI itself

olive lintel
#

I don't want it to move

#

yeah

mortal robin
#

why would it move

olive lintel
#

its not alighned anymore

mortal robin
#

that has to do with your anchoring

livid reef
#

why does my ui look different in game

olive lintel
#

thats what IM saying lmao

#

its dumb

#

I think its because the scene view isn't correct

livid reef
#

look

#

even right?

olive lintel
#

yeaH

livid reef
#

in game

olive lintel
#

lmao

livid reef
#

look

#

even

olive lintel
#

lmao

livid reef
#

bro like

#

WHAT IS THAT

livid reef
livid reef
olive lintel
#

I can;t help you

livid reef
#

how do i make the slider middle pattern thing look better this is a test project for testing stuff

olive lintel
#

how do i make it so that an image doesn't cover objects

livid reef
#

like the ui?

#

not sure

livid reef
#

ye i need to do that

olive lintel
olive lintel
#

do ya think this is too high detail?

#

or to low?

#

lmao I spent 20min on it

scarlet owl
#

How to make an animation play in OnDisable before the actual disable gets called?

cerulean spoke
#

can anyone help me i tried to make my self a scroll view with buttons it kind of except for the content in the viewport. the Content teleports to a random point on the canvas after starting and closing the game I didn't started coding yet

#

prestart

#

after closing the game

flat ibex
#

Does someone know how I can delete the green screen of a video clip?

stone oxide
#

hey all, I have some action buttons that map to keyboard / xbox controller / playstation controller / touch, depending on the platform. for touch (mobile only) these buttons should be big and interactable, for desktop / console the buttons should be smaller, more of a guide than actual buttons. what do you think the best approach would be to handle this scenario? 2 different UI setups or scaling RectTransforms on one platform? or something else?

livid reef
livid reef
#

why does my ui lose pixels in game

#

in game

#

^ in game

#

in scene ^

cerulean spoke
#

XD

livid reef
#

lol

#

ye my bad

#

how do i make it look like that

#

and im not reading any articles or anythjing since my attention span when it comes to reading is that of a 2 yr old

stone oxide
#

i would start reading

#

i actually have no idea

#

i'd start by checking texture filtering settings, game view resolution

livid reef
#

wheres that

stone oxide
#

missing keyboard bindings atm, but what do you think on the input device switch notification?

livid reef
#

damn

#

pretty good

stone oxide
livid reef
#

oh i already done these

stone oxide
#

ok, but we need more context on the issue

livid reef
#

wait

stone oxide
#

is it a pixel type ?

livid reef
#

for format i was always told to do rgb 32

stone oxide
#

set it to point

livid reef
#

this is mine

stone oxide
#

is this being used in the UI?

#

hmm

livid reef
#

yes

stone oxide
#

maybe your texture is too low res?

livid reef
#

this is my test project

#

maybe

stone oxide
#

what's the image size?

livid reef
#

let me chekc

stone oxide
#

the original

livid reef
#

1800 x 200

stone oxide
#

wait, each banner is 1800x200 ?