#📲┃ui-ux
1 messages · Page 62 of 1
Hi, I am building a game for MacOS from windows. and I got issue with TextMeshProGUI won't be rendered especially for MacOS Big Sur or higher. Any body have the same issue like me?
From the image, there is should have a text in the button. (Using Text Mesh Pro Button) and all my text using TextMeshProGUI wont appear in MacOS Big Sur and Higher.
what would be the best way to see if i have a setting in the options where you can set a name but warn the player if its too long?
problem is that with no caps, this is only 17 characters long, but if i have for example full caps it's only 14 characters long
Do you use the same font in world space as in UI somewhere ?
You can set a max limit on a TMP Input field, and just have a hard cap
Can it be that because of different screen scale, the font doesn’t just fit in the text box?
wait where do i do that exactly?
It's on the input field
Is there a way I can "exit" an InputField without de-selecting the Selectable?
It's mucking with my gamepad navigation
input.DeactivateInputField seems to not actually do anything, so I don't think it's that
Yes, some of Text UI (not TMpro) using same font
Hmm, probably. I used different UI scale in some part of my canvas. But if this the reason, how can this happened only in Mac?
So I'm trying to use some custom fonts with TMP put they are coming out blury/pixilated. I used mostly default settings for camera, canvas. Although I did switch to scale with screen size.
Any ideas on where I should look to try and make the text more crisp?
I am new to unity and I created a button. but the canvas thats created is much larger than the camera. do I increase the camera size or decrease the canvas size? the screen seems to ignore the actual camera but doesnt work if deleted. this is for 2d. sorry if this is the wrong channel
is the Canvas's render mode Overlay?
if it is, it's normal. overlay canvases are based off your screen size
Don't scale the game view to 1.7x its size
screen space - overlay
yes, so the Canvas will match your screen size. it looks big because Canvas uses pixel unit, and it's being represented in the scene view as 1 pixel per 1 unity unit
just place your UI based on how you see it in the game view, using proper anchoring
https://docs.unity3d.com/Packages/com.unity.ugui@latest/index.html?subfolder=/manual/UIBasicLayout.html
you'll find this useful. it's pinned in this channel
ah thanks
Ahh yeah that was causing it to be pixilated. I'll try tweaking settings now that the zoom is reset and go from there. Thanks!
Anyone knows why I might be getting blurry text? Its only when I use splitscreen. The canvas are using Screen Space - Camera
Hi 👋 canvas.overridesorting = true is not working even though the gameobject is in active state is there any way I can achieve it?
so much of the built in unity UI system seems to cause significant GC, and like calling GetComponent internally etc.
so like ... it's not like a little is causing actual performance issues in my little tests but i'm just worried if i build an actual full complex UI on top of this that's when the issues will start showing up
Right now it is calculating the difference between the start of container that holds the two buttons at the end
But I feel like that's the mistake
can you show the RectTransform of the horizontal group and the input field?
I think maybe the easier way would be to add a LayoutElement onto the input field, tick "ignore layout"
then you'll be free to center the input field, and it won't cater in the other objects in the layout group
try and see
you can go to free aspect and try resizing your game window
it should
maybe not because I dont see you set your horizontal layout group RectTransform to stretch, so it would be a fixed size regardless
but the input field will remain in the same spot relative to the parent
Wait, I got a better idea, I create two panels that both center the items. The first one contains the left button and the container with the two buttons, and the other panel the input field
sure
or put the layout group component on a child of the panel, and put children you want affected by it in it
then put the input group still a child of the panel, not a child of the layoutgroup
Gotcha, thanks for the help :)
Hi I'm very confused why unity isn't working I've tried everything but it just won't display the highlight nor press color on my button.
I've recreated in another scene didn't work I've restarted unity didn't work I've deleted it and recreated it in the same scene didn't work I've tryed multiple colors didn't work...
So I'm thinking it's more a unity problem
idk
Do you have an EventSystem in your scene
Also, are the alphas meant to be so low
Your Target Graphic is named Play. Are you looking at the right graphic
Nah you're definitely missing something. Show what you've got in your scene in the fresh Scene
Yes
In the hierarchy
ok actually it seems to me like the image has 0 alpha to begin with. So none of the transition colors are going to matter
Set the color of the image by default to be full white with full alpha
then set alpha etc for each of the selectable modes as you want
at best you're going from fully transparent to a very transparent very dark gray
it won't be noticeable
Okay
Ty it worked
Hey everyone I've been trying to work with scale with screen size for my UI for it to well... scale with screen size
but everytime I try to resize everything for a screen size
when changing the size it just doesn't scale properly
things get stretched out with wrong positions and I'm not quite sure what to do
here's an exemple with different sizes
bottom menu is out of bounds
is there a ui element for highlighting something
to put a glowing ring around it
or some script method
anyone know why xr canvases are huge?
Please don't cross-post.
Canvases are representing screen space in world space, that's why they are big.
ok sorry for cross-posting, is there some way to make it easier bcs rn when for example adding a toggle to a canvas that is scaled to a good size, the toggle is huge
The toggle should be a reasonable size in screen space
if you're creating a world space canvas you will need to scale it down
so do i not change the width/height but the scale?
You haven't really described your setup
is it a world space canvas? If so, you do need to scale the root
i need to create a button that upon selecting, acts like a toggle. selecting it twice change scene
how can that be done
how to make the screeen resposive on mobile screen?
i want it to have max 700 width
on mobile screen it clipped
not centering
set the canvas scaler of your canvas to scale with screen size
i did
i want it to display maximum 700 width
on mobile i want it to resize to whatever
just centering the screen on bottom
what's the anchoring of the text box
it's near useless that you're showing me in prefab mode
but honestly, i dont know now
I usually fix blurry text easily but for some reason this just wont go away
these are my settings
nvm found fix
It's an anchoring issue I think
anyone know why the text is like that its supposed to be black
did you set the alpha to 0?
in my project, block raycast component doesn't work at all. I tried in canvas and panel. How can I block mouse clicks behind the panel screen? ( dont want to click 3d objects)
I am using a second display. my canvas is rendered to the first display on startup. I then have to move it to the second display (I change the cameras targetDisplay), after this my canvas is no longer responsive in release mode, but does continue to work in the editor.
I know mouse clicks/position are working correctly, as I am using them to render some effects in the background.
any idea how I could debug what is going on here?
oh and while I am at it, what the hell are these yellow lines:
I've disabled all gizmos
how do i get my vertical layout group to fill top down instead of filling weirdly like this
np
UI Navigation
you must have enabled it on a selectable UI object
so this is some component on an object? I just added this textmeshpro button
A button is selectable, so yes
ok thanks hmm
how do i make it so everything outside is invisible
use a mask
on the content rect presumably
i've got a mask on the content doesn't work
what kind of mask
that mask uses a graphic
if you don't want to use a graphic, a Rect Mask will-yeah
but now some of the elements are missing, even when scrolling
in the inspector they exist
but not when i scroll
there should be one at the bottom with this text, then then this happens (pic 2)
anybody able to shed some light on this?
is there a way to fire my own mouse-up/down events?
Why's ui text so low quality
use TextMeshPro
And how to apply custom fonts to it
how to display on screen keyboard?
i have input field on game
if user connect their controller e.g xbox or PS4 controller
nothing appears
they cant type anything
err i have an issue where my pivot wont move to the corner of the canvas, only to the corner in a small box
it works in a different scene though which is hella annoying
Hello! Working on my game UI manager, I'm wondering how you guys deal with the canvas management of different UI screens. Is a state machine a good route to look into ?
how do i stop my scrollview content from going so far out of bounds you can't get it back?
If you set it up correctly, it should not go out of bounds. Is your content inside your content parent correctly set?
I was just building a UI system that has some global classes for Page and then states they listen to for example. So you can turn off all pages and activate the needed and do some child parent control to get subpages and what not. one approach.
I'd wager that your content rect is HUGE and not resizing to fit around the actual content
i ended up sticking a content fitter on, does the job for now, although when there's only one entry it sticks it in the middle instead of going top down, but it's fine for now
change the vert layout to start at top middle, instead of middle center
Programmers attempt at some UI stuff.
Question:
I have a 16x16 tile based UI. I've never used tile based UI's before, only 9 Slicer, and I'm wondering,
How do I go about implementing it in Unity?
I don't think they're the same thing...? A 9 slice is to cut up 1 image so that it can be stretched without messing up the corners
a "16x16 tile based UI" sounds like it's 256 separate images?
Thats pretty much the case that I'm trying to figure out. As an example this is what I'm referring to.
If I slice it up as 32x32 tiles. Everything fits besides the things that should be 9 sliced.
I understand I could drag out the tiles and resize them. However, I was hoping there would be an easier way.
right, that's an atlas
It also seems like theres no easy way to add new slices to an existing?
I know, I understand what a 9 slice is. But the larger boxes in this case, would be 9 sliced easily for scaling
I assume once you've cut up the atlas with the sprite editor, you can also then setup the 9slice stuff on the individual sprites created from that
I guess at the end of the day the question is.
Can I add a slice to a sprite sheet/atlas manually? Or do I need to go in, count all the number of elements I have, then tell the sprite editor to say slice it up as 1x# THEN manually go in and resize them?
That I dunno, ask in #🖼️┃2d-tools
trying to use unity premade scroll bar auto hide feature on a previously made scroll section, it isnt hiding anything though, anyone know what might be causing this ? i have the proper scroll bar added to the scroll rect
I tried making a new one and the new scroll bar stay inactive and i can not turn it on manualy
Hello everyone. I have this issue. I am trying to make my text disappear into the shadows when using the unity2d lights but i can't figure out how to make it blend in with the shadows where there is no light. (this also happens on my health bars which are sliders)
I am using sorting layers which work on sprites but on the canvas and text they don't seem to work...
Is there a TMP feature for being able to select/highlight text in game and right click copy?
Far as I can tell, the low budget way to allow copy of read only text is to use Input TMP with read only activated. Then get rid of all the input graphics/highlighting.
Hey hi I want to position a 2d image in a UI canvas to point a gameobject in worldspace?How to achieve I came to know that we can use the worldtoscreen point method but not sure how to use it...Kindly help me with this...
Hello, is there a way to "Use child scale" without a layout group ?
How do I make a scrollable bar but only left and right?
Use a scrollbar component and set it to horizontal.
@mild kernel How do I make the scrollbar effect something like a frame's position?
Or like make something move
Attach the scrollbar to the scrollbar field of a scroll rect component.
Does anyone know any program to layout my application, before passing it to unity?
@mild kernel Maybe I'm blind but I can't see it-
A scroll rect component that you've added to a object.
Why is that when I make this only horizonal the vertical scroll bar is still there?
I have this text that zooms in at the 5 second mark in this clip, I'm looking for advice how to make it look nicer if anyone has any pointers, thanks
How do I make a scrollbar effect a frame's position?
how can i set a texture from a list of textures for an image
instead of having one image it can be from a list of them
Because you still need to delete the scrollbar. That just tells you which direction you can scroll
I've a problem that seems that the clock I have doesn't render, but the text does render, what can I do so that the clock can be displayed?
use Image, not SpriteRenderer
Thanks :)! Stupid mistake from me xD.
guys
i clicked something
and none of my ui preview is visible
how do i fix that XD
sorry im new
@rapid ferry Don't ping people, it's obnoxious.
Good evening/ morning guys. I wish to slow down time when I'm in my weaponwheel. Of course I would like the animation of my menu to not be slowed down. So do I have to compensate by accelerating my animation or is there another way to do that that I don't find ?
How do i set priority in ui? I want to be something on top of other image
It's based on the organization of the GameObjects in the hierarchy within the canvas.
When it comes to multiple canvases, different canvases are sorted based on sorting layers
Oh okay
And second question
@mortal robin
I did an animation
that only shows up when u hold a specific key
and right now its not visible from the point of Scene when editing
but in game it is
how do i change that?
I just dont want canvas to play animations
Huh
Show what you mean
But probably you just have the usual confusion about canvases and how they're drawn in game vs scene view
I want this selection wheel visible without condition to held a key
is it possible?
I think it is
@mortal robin
Of course it's possible I just have no idea what you're doing or how you're doing it so I can't help you with the how
as im saying
I made animation
that shows that button only if specific key is clicked
and now i want to edit it
but i cannot because it is not visible\
And can i disable animations when im in editing mdoe
so it will be visible
@mortal robin
Entry animation like a ground slam for all the characters (rather than they phase in and are idle).
Faster transition from start to (second page or whatever)
okay so my canvas is really wonky and idk why. if i click on e.g Play Online right on the red dot, Play Splitscreen becomes clicked
same thing for options and what not
this broke when i set the canvas to screen space camera. i reverted it back but it's still broken
actually, even clicking on top of the button registers the one below it
tried making a new canvas, still broken. i have no idea what the fuck happened, the settings are the same as it was before it broke
Check that your text or whatever graphic is not overlapping the other buttons
there is nothing overlapping it, it's on top of the canvas hierarchy
anyone alive in here 🙂
hi guys, im a little bit confused about the scaling of the canvas. Ifi started in unity with say 1920x1080 then drag the window smaller during runtime (down to say 900x600, everything scales perfectly. But if I start unity in 900 x 600 then everything is overlapping etc. any ideas?
centroid: seems like there must be some boundaries overlapping the other buttons, if u turn on gizmos and click on them u should be able to see it
damn i miss irc where people would respond 🙂
oh wow, i needed to pass false when parenting! works
Hmm ill check it out. Apparently its only the buttons suffering from this and not the whole canvas
It has a vertical layout group too idk if that affects anything, but i’ll check out the boundry thing though
@warped yacht err im a bit confused, what am i supposed to see here?
you should just untick the raycast Target on the text
if you're using Textmeshpro, it's under the extra settings
👍
You can easily catch these kids of errors by selecting the eventsystem while testing @neon terrace, it will tell you whichever gameobject is being hovered
Suddenly, a bunch of my UI images are super scaled up like in the image here. Any idea what could have caused this?
They've been moved around in the hierarchy?
If you move things in the hierarchy to be under different parents with different scales.. they could end up messed up
ALL UI elements should have their scale at 1,1,1 (only changing with animations)
All scales are 1,1,1, the hierarchy has not changed at all so not that
got any layout elements? toggle stuff off/on
Are you on free aspect
No
Not as parents to these objects
Changing aspect does not change how they look.
The super strange thing, is some are fine, others are not. E.G.
This one is fine
This one is not
They are right under each other in heirarchy
They are identical other than their rect transforms
So I created a viewport-based rect representing the '2D' bounds of a collider, and I'm trying to position and resize a canvas image to match. Resizing works fine but after multiplying the position by the canvas' pixel rect, the position is offset by a consistent screen value (as in if I move the camera, the image shifts the same distance as the object and is still equally offset.
I think it's due to some weird calculation error between the corner and the centre, so I tried halving the pixel rect size and subtracting it from the position value, but that causes the image to judder around slightly to the bottom left of where it's supposed to be, even though the pixel rect size doesn't change at all between frames. Any idea what's happening?
Okay so I did some more testing, the position value being output without the offset is totally fine and consistent with the object's screen position. Yet the image is still positioned wrong. I've been messing around with the pivot and anchor data for the RectTransform but it hasn't done anything
hello, i have a small question anyone know a good quick tutorial showing how to use a vertical scroll slider?
@copper meadow the anchor in your first screenshot is for the settings text/ image. But the issue is with the background.. I assume you have it set to a size, instead of to stretch with it's parent
yes. i have set the anchors on all corners for the background
how was i suppose to do it?
is this the problem?
fixed it. works now. thanks! @low pike
trying to find a way to get the screen pixel position (bounds) of a RectTransform and failing - am i missing something or do i really need to do my own calculations
Tips on improving this menu layout? (Icons are only placeholders for now)
layout
I dont really understand the ui thing at some points. Any Resource that helps getting into it? I understand what a pivot is but the things like Content Size fitter, Vertical layout group, Layout element and different resolutions is a thing i dont really understand yet
in the hierachy the "Frame" Object works fine with its children. But somehow its not auto scaling to its parent
i cant add a verticallayoutgroup to the "Panel" because i already have one in the "Frame"
The default anchor setup doesn't resize with parent changes. It's anchored to the center
Yes you can..
What happened to the Grid Snap Settings?
got another UI issue. rn im using explicit so that i can set my own navigation with the buttons
problem is that if i change option category it will keep then navigations
problem is that explicit only allows one UI element/direction.. so uh... do i have to reassign this by code or?
ugh this will be ass to fix... 
seems like i gotta do stuff by code
Is using multi scene workflow a viable approach for handling UI menus ? I.e load/unload additive scenes that just contain a canvas and event system
yes, but you only need 1 event system active at a time
Thing is for navigation I need to specify the first button to set as active
Is better to have 1 event system per UI scene and set it in editor or 1 global event system and update the first selected from script .
Only 1 event system works at a time, if you load more than one, the second one loaded is ignored
You will need to manually set the active selectable when you want the required change to happen
Okay thanks !
@brave iris
Was working on this one screen which has a scrollview for the buttons but the issue I'm having is whenever I try to scroll it, it snaps back to the original position again
This is the screen I'm working on
And I have a tutorial I was referencing
A crash course in setting up a ScrollRect within Unity as simply and quickly as possible.
This one
I did everything as he did as far as I'm aware
But when his scrolls it stays in place
the scroll rect needs to be the size of the elements within it
if it's smaller than the scroll area then it's gonna snap
So do I just adjust the height of the gameobject that has the scroll rect in?
I'm guessing, because I can't see the setup from a screenshot of the game .. if what I've guess is correct, then yes, that is what would fix the container being too small
I mean from here
I don't know your setup, that's not enough information for me
okay wait I got it
This was the setup of my menu
I just changed the height of buttoncontainer
That seemed to fix it
If the container for the buttons is smaller than the buttons (the red square) it won't stay where you scroll too. If it's bigger, like the green.. it will stay where you leave it.
Thank you I got it working now!
A content size fitter, on ButtonContainer, will probably do the job for you
and will auto re-size the container if you add/remove/disable buttons
I tried content size fitter before and it didn't do much
you probably left the drop down at "unconstrained" which means it doesn't do anything.. did you try the other options in the only two dorp downs available?
If you did.. then the button objects (visible in the screenshot above) aren't sized correctly...maybe. /speculation
hey, i'm having this weird issue with TextMeshPro (not TextMeshProUGUI!) components where it will have this odd ghosting effect when the text is updated. Anyone know a fix?
I actually don't see any ghosting at all
It's possible it's an artifact of your monitor
I have that issue with one of my monitors that is more of a "work/productivity" monitor and not a gaming one
it's not really ghosting, but you can see the numbers on the gun morphing into a different one. i see it on all my screens, even on different devices, so it's most definitely there
oh lol oops. i should've been more specific
i doubt it? maybe it has to do with my font asset, i'll try using the default one in a bit
test with no post proc too, confirm it's not making a difference
sorry, took a while, got lost in netcode. turned off TAA and it's gone.
Ahhh
that makes sense
TAA does antialiasing involving previous frame data
it could absolutely create that blending effect
i'm also having an issue where my UI TMPros that use my custom font are not showing when something is on the near clipping plane of my camera. this doesn't happen with the default font. i can not see any obvious differences between the font assets :(
see clock in top right corner
I wonder if it's related to this issue?
yup! thanks
lucky string of events. Someone else mentioned them luckily stumbling upon that thread and I happened to notice them talking about it yesterday
trying to move this text using the move tool, but the arrows for some reason aren't there. They used to be there, it only appears if I zoom out real far. How do I fix this?
I think it's related to the gizmos getting clipped by the scene camera near clipping plane
so maybe adjust that in the scene view camera settings?
ok I just increased the near clipping a bit, it works now but idk what I just did
I'd expect it to work when you decrease the near clipping distance
i have some nested layout groups and when i instantiate a prefab into one of it, its not updating. its only updating after the next object was added to the list. i found a lot of tricks and workarounds on google, but they are really old (some from 2015 etc.) and i tested some of them but its not working. what i found out is that unity does not update the vertical layout group childs when a new child was added. Any ideas how to force them to update?
i tried that, doesnt work for me
which recttransform did you pass in
the recttransform of the vertical layout group
you mightve seen this already
https://answers.unity.com/questions/1276433/get-layoutgroup-and-contentsizefitter-to-update-th.html
Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
not seen yet 😄
damn
seems to work on the root but the childs which also has vertical layout groups are not updating
i usually just need to put the ForceRebuild thing on the root.. but sometimes it's not enough. Quite an annoying issue
is it just an issue of unity or is it probably my bad because i used lots of vertical layout groups as child with content size fitter
i haven't found a working solution yet
um.. it's a unity thing
most people want resizable scroll views and stuff, and that almost always requires a vertical layout group and a content size fitter
no matter what the warning says
it's kinda known that Unity's ui system is a small piece of hell sometimes
ok i got it to working better but not perfect
private IEnumerator RefreshLayout(GameObject layout)
{
yield return new WaitForFixedUpdate();
Canvas.ForceUpdateCanvases();
VerticalLayoutGroup[] verticalLayoutGroups = layout.GetComponentsInChildren<VerticalLayoutGroup>();
foreach (var verticalLayoutGroup in verticalLayoutGroups)
{
verticalLayoutGroup.enabled = false;
verticalLayoutGroup.enabled = true;
}
ContentSizeFitter[] contentSizeFitters = layout.GetComponentsInChildren<ContentSizeFitter>();
foreach (var contentSizeFitter in contentSizeFitters)
{
contentSizeFitter.enabled = false;
contentSizeFitter.SetLayoutVertical();
LayoutRebuilder.ForceRebuildLayoutImmediate((RectTransform)contentSizeFitter.transform );
contentSizeFitter.enabled = true;
}
}
last message is the problem here
idk but it doesnt update the spacing in between the last element and the one before it
show the your vertical layout group component
vertical fit, try preferred. on your content size fitter
private IEnumerator RefreshLayout(GameObject layout)
{
yield return new WaitForFixedUpdate();
Canvas.ForceUpdateCanvases();
VerticalLayoutGroup[] verticalLayoutGroups = layout.GetComponentsInChildren<VerticalLayoutGroup>();
foreach (var verticalLayoutGroup in verticalLayoutGroups)
{
verticalLayoutGroup.enabled = false;
verticalLayoutGroup.enabled = true;
}
VerticalLayoutGroup verticalLayoutGroup2 = layout.GetComponent<VerticalLayoutGroup>();
verticalLayoutGroup2.enabled = false;
verticalLayoutGroup2.enabled = true;
ContentSizeFitter[] contentSizeFitters = layout.GetComponentsInChildren<ContentSizeFitter>();
foreach (var contentSizeFitter in contentSizeFitters)
{
contentSizeFitter.enabled = false;
contentSizeFitter.SetLayoutVertical();
LayoutRebuilder.ForceRebuildLayoutImmediate((RectTransform)contentSizeFitter.transform );
contentSizeFitter.enabled = true;
}
ContentSizeFitter contentSizeFitter2 = layout.GetComponent<ContentSizeFitter>();
contentSizeFitter2.enabled = false;
contentSizeFitter2.SetLayoutVertical();
LayoutRebuilder.ForceRebuildLayoutImmediate((RectTransform)contentSizeFitter2.transform );
contentSizeFitter2.enabled = true;
}
this is working, i added also updating the layout itself and not just the children
but its so ugly solution/workaround 😮
any idea why my parent object does not scale to the child size?
Parent (Not scaling to the child text):
Text:
it needs a content size fitter, with vertical preferred
the parent?
oh
or, you could make the background a child of the text
and have the background stretch
so it'll stretch as the text expands
as a child it would overlay the text
good point
i did this before, can't quite remember the solution.
Try adding a content size fitter to the background
yea that worked
Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
Hey can i get some help plz. My circle sprite is really blury.
what is the texture size
this 1 is 512x512
keep in mind I said the texture size btw, not the UI size
try setting it to trilinear
u mean this size down here? cause i made the original circle in PS and made it 512x 512 been testing to try get it crisp so now its this
trilinear doesnt do much
if your UI is 512x512, try using a circle that's 512x512.
what like pressing (set to native size)?
no.. use a bigger texture
well i set to native size it worked but now it huge
long story short, just use a texture size that matches the size of the object that'll be in your game..
ok
@sterile wedge the mask component is making everything blurry, any ideas now?
Masking in Unity has never had soft edges. You need 3rd party plugins for that. Try using a texture with a higher resolution for the mask
ok thx
I have 3 elements in my vertical layout group and i want to add a slide function when the minimize button is clicked. it should only minimize the middle element. i tried setting the minHeight & prefHeight of the middle element to 0. its working but in that the bottom "chat input" line is moved to under it because it has a minHeight. I cant remove the minHeight of the chat input because then its not visible
the middle element (content) has also a vertical layout group, that splits it into the display chat and the input chat
any idea how i can change the chat input line (which has a min-height) so it tries to use a specific height?
i have the 2 elements in my vertical layout group. i want that the top one scale as much as space is available and the bottom one to use between 0-40 but try to use 40
solved. For some who faced a similar problem: on the bottom element i set the prefHeight to 40 and on the bottom i set the flexible height to 99999. so it first try to scale the bottom one to 40 and then scale the top one to maximum
having a bit of a problem here
i'm trying to implement a menu where instead of multiple scenes i move the camera from one place to another (kinda like the tboi menu)
i set up some buttons and made 1 canvas per menu so anchors dont get messed up when scaling
i set the canvas render mode to world space and scaled them with the the rect transform scale
and now theres a single button that always gets triggered no matter where you put your mouse, like if it had an enormous hitbox
what am i doing wrong?
nevermind, i made some new buttons and now it works fine. it seems the scaling messed them up somehow
these button icons are sprites, they show fine in the editor but when i run the game they just.. disappear?
the import settings should be fine
but when i run the game they just.. disappear?
To clarify - by run "the game", do you mean press play in the editor? Or in a build?
when I play in the editor
at editor play time, are the references still assigned in the inspector?
...i just accidentally pressed don't save when restarting and lost 3 hours of work. i guess i don't have the problem anymore for the time being 😔 thank you anyways
you went for 3hrs without saving? 😮
appears so somehow
how can i fix my buttons and texts scaling
they change size with dif resolutions
its so messed up
- make sure your game view isn't set to 'free aspect'
- set the canvas scalar to use a resolution
- set the resolution to something that fits your needs (probably 1080p is a good choice)
- set the slider to change with whichever width/height you want it to be
what sliedr
Do you do everything above it?
I put them in that order for a reason, if you pay attention to what you change.. you'll see the slider
I don't have Unity open, I'm unsure what the fields are actually called
Yep, that's the one
that slider doesnt do anything
It does
i didnt see any difference
It's just not doing anything for your current UI setup
so I'd say just pick all the way left, or all the way right and not care
you're working in portrait mode too, yeah?
yes
for mobile?
yea
Using the device simulator?
what simulator
it's a package for mobile devs, instead of using the game view.. you can select different mobile devices to see real time screen size changes
package manager -> swap to unity packages -> import device simulator
dunno, never touched it.. you'll have to read the docs
Any idea why the scrollbar value jumps to over 1 sometimes? i append a new element in a scroll rect and sometimes (about every fourth time) its just jumping to 1.6 but the view looks correctly. i already update the view but somehow unity set that value to 1.6+. usally 1 is max. 😄
main problem i have with it: it is correctly displayed but i need also a way to check wether the player has scrolled to the bottom currently but with that wrong values its always false
Hi, I have a problem with my text, it kind of glow and it look really weird. does someone know how to make the text less ''glowy'' (to make it more realistic)?
how...?
i cant have two shader at once right?
why would you need two?
um
since i want to unlit the text i need two right?
look
oh wait
it work
i found a way, sorry if I bothered you
Hello all, im trying to use Horizontal Layout and Vertical one, i just wondering what's this red line do?
nvm i know what this used for...
okay it turns out it's not a red line... i had no idea what is this
Those are RectTransforms with negative height or width
Based on your anchor and pivot settings they've gone inside out basically
hey uh
im working with unity's 2D shapes as provisional sprites for my game and im running into an issue
whenever i put one of those sprites (say, a circle) into an image's source image it turns it into a square
how can i fix that? should i just google an image of a circle and use that instead or smth
is the circle white?
perhaps it's background or something?
yeah it was
dont think so(?)
still it doesnt matter now, i ended up changing the image for a spriterenderer cuz it was giving me trouble with changing its material's values anyways
i made the canvas scale the ui's with the screen size and everything works fine but when i instantiate a new ui gameobject it's scale is cursed in everyscreen
Hey I need some help with my UI in my 2D game
I have the UI on a canvas, and if I set the Canvas Scaler to Constant Pixel Size, UI elements get all messed up at different resolutions, even between like windowed mode and full screen mode. Things just dont stay lined up.
However if I select Scale with Screen size, it keeps the positions and sizes of everything proper at different screen scales, however it really messes up the pixels, as seen in the screenshot:
https://i.imgur.com/xjqiEQp.png
Any idea what the solution here is?
anyone know how to fix this issue with text mesh pro? an ancient forum post i found said to increase padding size but that didn't fix it.
really need to figure out this UI issue... I want to do title cards for areas, and lots of other UI related stuff, but I can't have my pixels looking all scuffed like this...
and like I said, cant do constant pixel size or even constant physical size, because they both have the issue of not scaling with the game resolution
the alternative is to just pick a set resolution and dont allow full screen, but thats not great either
Using something like this is the best thing to do https://assetstore.unity.com/packages/tools/gui/procedural-ui-193375
(if you can spare the small amount of cash)
You need to set the parent in the instantiate, otherwise you instantiate it off the canvas.. then you move it on to the canvas.. the scale will be at 50 because of this move.
i have already did that
but still
show your code for the instantiate
I havent been able to find any solid information about this issue, does anyone have any information or a good direction to go for this issue? I am stumped.
Again, it is that I am making a 2D pixel art game, and my UI elements are being eviscerated by canvas scaling... but if I dont use canvas scaling, my UI elements will be wildly different sizes and locations at different resolutions, which is just not acceptable
Honestly, I don't know what's wrong here in this picture
the line between the red arrows is 5(?) pixels thick. The line between the black arrows, is 1 pixel
it looks awful, the pixels are all squished and stretched in places.
Both of those lines should be 1 pixel thick (or remain the same size when scaled)
the issue is that the scaling is stretching pixels, and pixel perfect doesnt help because that just aligns the pixels after they have been stretched
for reference this is how it should look
https://i.imgur.com/g9pngpG.png
side by side, you can see the difference clearly
Asking here because it seems more fitting, but does anyone know why my text is coming out like this https://cdn.discordapp.com/attachments/497874081329184799/957981349904515082/unknown.png
both lines are supposed to be identical
Wanna give us more details?
Are they TMP? same font? what's the inspector look like? is it UI? world space UI?
The idea is that they are walls in a curved runner game with text on them, so curve shader need to be applied:
- This is a World Space Canvas
- This is Default unity Text UI Component
- They both use the the Font
Library/unity default resources/Arial
This happens when I change the Material (and hence the Shader too). I just really want to know what a Shader with ShaderGraph is expecting to be able to render Text
Can someone explain to me why does when i use Aspec Ratio 16:9 it's had different outcome when using Fixed Resolution, is it suppose to be same? 16:9 was 1920 x 1080? or i just misunderstood about this one?
yep, i found this solution yesterday. it turns out my panel was flip in the wrong directions. Thank you
Depends on your canvas scaler settings
i had my canvas 1920 x 1080 using scale with screen size and as for screen match mode expand ( i want to take a screenshoot but my Unity not responding rn )
How do I make an escape menu with the background being the game live but blurred?
postprocessing to blur the main camera and a secondary overlay camera to draw the UI on top
thanks I'll try that later see how it goes
by that i mean my dev friend will
I have been using a vertical layout group to have some menus, But I wanted to have some of the buttons be side by side while still being stacked vertical, instead of 1x5 be like 2x5, is this possible with the vertical layout group or will it keep forcing them to be on top of one another
I made an empty first and just made the content children of the empty and that worked, not sure if this is a half ass way of doing or an appropriate way though
either use GridLayoutGroup or make the buttons live inside of a parent "row" object that contains both buttons, then make the "row" be the thing in the vertical layout
Thank you, I didnt even see the Grid Layout, I am going to fiddle with that
You don't want a grid layout for this
Keep the vertical layout group, and where you want things side-by-side, create an empty GameObject and put a horizontal layout group on it.. with the buttons as children
- My hierarchy is
Canvas -> empty -> button -> image. Image appears behind the button whatever i do, even when i make it a child of canvas directly. How to place it above the button?
If image is a child of button, it will be on top of it
Show the inspector of the image please
Inspector
- Nvm, this was meant as an answer to carwash
That's a SpriteRenderer, not an image
If you want it to be a UI element, it needs to be an image
You can't drag and drop sprites from the project window into the hierarchy when doing UI
- Noted, thanks
How do I fix the small text or big text on diferent screen sizes?
Hey y'all I have a UI question here regarding anchors.
So I understand how anchors work in regards to the screen and that is fine for 90% of what I am doing.
The issue I have is that I have a UI that needs to be relative to a background image as the resolution changes.
Is there a way to set anchor points based on game objects instead of the Screen resolution?
you can do use worldtoviewport on the camera
awesome! thank you!
Yeah, like the other guy said looks like your anchors are off and/or you don't have a canvas scaler component on your canvas
Just find a tutorial on UI scaling and anchoring
This is something you need to learn to do, and not hard. Just a little confusing at first
Ok, fair enough. Not mine
im trying to make a ui for my gam (the first ive ever made) i have the anchor preset set to the top left but when i maximize on play it is in the same spot it is unmaximized but it isnt scaled with the sene veiw so it almost in the middle
using a TMP text how do I make it so that the rect fits the text, instead of the text fits the rect
ok got it, content size fitter
How do I see the UI in scene mode ? Or do I have to view it in game mode?
Double click any object in the hierarchy to move the scene camera to it
I don't think you can do anything about it. If you want it to be placed somewhere in the world instead of having it mapped to the camera you can change this setting
Then you can scale it and move it somewhere in the world
If it is annoying to see the big canvas in the scene view when you're not editing it, click this eye icon to hide it :D
.
[2020.3.16f1] Why can't I see the UI tab in the create menu? I can add the components manually
I read that it could be fixed by removing the Unity UI and TextMeshPro package, but I can't remove the Unity UI package as it is depending on the Universal RP package
I tried reinstalling the TextMeshPro package only as well as restarting Unity, but it didn't work :/
The only way for me is this
what's your unity version?
2020.3.16f1
Hey everyone, Im building a speech bubble UI for my game, where the speech bubble will be on a canvas attached to a gameObject so it'll follow the NPC around. I was wondering what render mode would be more appropriate. World Space or ScreenOverlay. Im not 100% sure when to use which one
If you intend to child it to a game object, you have to use a world space canvas.
Ahh I see, thank you! I'll make sure to continue with world space then :)
Hi, i've been watching videos I could find on the following but still NG. I'm attempting to get a UI particle system to display on top of a ui Image. I've set up a ui camera & got all that working but A) the particle system only shows up in the scene view. B) the particle system only draws behind the image in question
When I select the camera I'm using for the ui elements, the little preview window displays the particle systems as well (though still behind the image)
Figured it out, the particle material doesn't like to draw infront of other transparent objects
Halo
I have an InputField, with a vertical scrollbar in the chatbox
If i click n drag the scrollbar, the scrollbar gets selected and the inputField loses focus
Is there a way to...have the inputField to maintain focus?
How do I make a slider only go in some range instead of the whole parent? I mean like a max and min pos
all of that stuff comes down to how you configure all the little RectTransforms and pivots and offsets inside it
handle slide area
how do i use a scroll rect to scroll down a canvas?
Have you tried looking up a scroll rect tutorial?
yes
anyway ima look it up again but do i need to apply the scroll rect on the canvas?
I haven't the foggiest idea as to what that means
thx
How do I make a OnPointerEnter method call when an image element overlaps another image element?
do they both need raycast target enabled?
i have a really weird issue, anyone have an idea how to solve that?
in the game its not really updating the text (not set via script, just normal)
Its happening since i updated the font. If i change anything in the font settings and revert that with ctrl + Z then its showing normally in the game view also. I dont have any idea how that happens and there seems to be no answer on google
all instantiated text objects are working somehow
when i set the Z position of every child object to 1 it is displayed correctly. but methods like "SetAsLastSibling()" will not work with that because it sets the Z Position back to 0
and i cant move the canvas to -1 or something
untick "Raycast target" on the element that doesn't need it
the class needs to be on the gameobject or a parent of the gameobject, which you want to catch ther pointer events from
you can also only have one class catching the events
any idea? looking the whole day for a solution and cant find a solid one :/
All the Z positions should be 0, and all the scales should be 1,1,1
i have a problem
i have a button but when i click it it doesnt change the tint
only the tint? or is it not working entirely?
could someone please help me with solving this issue?
the image on the canvas always has some pixels smaller
some squished
some longer
and it's only in game view
not in the editor
this is how it looks in the editor
can anyone help me with it?
i can provide any info needed
and if it helps to know i already activated pixel perfect on the canvas.,.
Did you do preserve aspect ratio?
And is the image component size a multiple of the image size?
where do i find that?..
wait i found it
hmm the preserve aspect ratio didn't seem to fix the isue
what does that mean exactly?
click the 'set native' button
the rect transform
that didn't do anything when i pressed it.,.
so if the original image would be 30 pixels tall and 20 pixels wide, the image height could be 60,90 and so on, and the same for width?
rect size was already the same as the image texture then
hmmm
wait... i'm using a grid layout component
count it mess with the rect size?
could*
i'm unsure of what i am saying just incase
You might need the pixel perfect stuff - which I've never touched, so can't help other than to point it out for you to look into
Yes, grid layout forces the cell size, which means you can't change the elements within.. so the 'set native' button can't do anything
okay, i'll look into those too
i see
the native button works only when something else doesn't change it's size from what i understand
and by itself it's supposed to make the rect of the image the same size as the texture itself?
without anything getting in the way
yep
so if the sprite is 1920x1080, and you've sized it down to be 100x100.. pressing the 'set native' button will resize it back up to 1920x1080
okay i see
thanks guys, i managed to make it's size as the original image and it seems to have worked a bit better now
there's still some slight squished pixels but i'll look into the pixel perfect stuffs for it
thanks again! have a lovely day
I have a very simple ui icon, but its pretty pixelated, is there a way to smooth it out? Its just a ui arrow
what dimensions is the image file?
what size are you setting it as on the UI?
512x512 is the image dimensions, I also tried importing one that was 2048x2048
im trying to set it to be like 100x100
2k is far too big
512 should be enough
super hard to say anything else with nothing visual to go off when it's a visual issue..
the square appears but not in the game ,why?
What is it? SpriteRenderer? UI element?
sprite 2d
I'd guess it's just not in the camera's view
you would be right
Check its position vs the camera
thanks
I have post processing turned on, etc, etc... I am working on a title screen. on the left (editor) my text is VERY glowy... HDR, etc.. but on my actual camera rendering (game) my text looks nothing like the editor. I know post processing is on, i know glow is on... but left looks like a badass NEON sign glowing, right looks like its masked? text? or something, like the glow is CUT right where teh text basically is, there is no overglow or effects its very flat
LEFT = editor. Right = game view you can see the text is different
i tried to zoom it to make a small screenshot so ignore that part of it
TextMeshPro / custom font from google /
juiced it up to 100000%
see the game looks like a BLOCKED MASKED square
the editor looks like its unmasked somehow
I think this may happen when there's too little space between letter in the atlas. Try up the resolution then they work better with outlines
yah that sounds like the thing
cause i indeed had to make a atlas and i was looking at the atlas and its just a big image
Yes, also meant to say increase spacing for which you may need to increase resolution to compensate for quality loss.
I remember something like that being an issue
ok I figured it out. it wasn't anything with the atlas. basically I have a game camera with post processing and etc and a UI camera with nothing. so the UI camera was getting no post processing. if i turned on post processing on the UI, then I got EVERYTHING... which sucks, so I made a 'second' canvas with just glowing elements and i added post processing to that one, so now i have a UI with no post processing, clean for interaction, and then another canvas just for glowy crap etc..which I have to figure out if this is what I want or if i just load up some sprites from photoshop with glow on them, which probably is what most people do performance wise / ease of use
I need help
I have a script to test the hp bar
and it changes it
but it makes it invisible
and I have no idea what the problem is
please help someone
anyone know how to make my simple UI actually show in gam
I tried changing the Z axis and scaling it correctly but I dont know what the problem is
Show it in the hierarchy. And its inspector
I believe its just a problem to do with the layering, although when I check in 3D its Z axis is still infront of the 2D level
It probably isn’t even in the right place
Because I was testing with some different Zs to see if it was to do with the camera perspective
Its a tile palette
Double click the canvas
Show your hierarchy please
Is the grass an image?
Yeah its loads of the same image in a tilemap
Can you show the canvas’s inspector
Can you select the canvas, press f with your mouse over scene view, and take a picture?
Did you shrink the canvas? It looks a bit blurry but maybe I’ve forgotten what the canvas looks like
It shouldn’t be your camera size
The ui is overlayed over the screen, not the camera
Make it bigger
The canvas?
Otherwise your text will look tiny
Yeah if you did shrink it
so i have this canvas and none of the buttons are interactable?
i press esc to open it and none of them are interacable
It could be many things, though most commonly, you might not have a EventSystem in the scene (if you are using the new input system, the old event system should prompt you about this on the component), or you have a image with Raycast Target true thats blocking your interactable elements, or your elements dont have raycast target on (which looks unlikely in your case), or your canvas is not the top-most canvas your interacting with
im confused?
No you want to make sure you DO have a graphic raycaster and event system, but make sure your background has "Raycast Target" set to false, and that your canvas you cannot interact with, is above the canvas you can interact with
If you turn off your other canvas, does the one you cant interact with then work?
You might want to disable that script first, and see if you can interact with your canvas then
So then that script is the cause of your issue, you probably want to have whatever opens your canvas, to also disable that mouse lock script, then re-enable it when you hide your canvas again
alright thanks
how would i renable it?
Anyone know the best way to add a border to my game and have it scale with canvas size
what is going on with this text? how can i fix this
How can i prevent something from going behind my background ?
are they both sprite renderers or images
is this ui or not. which one is ui? more information please
one is an image one is a sprite renderer
the blue thing is a background
it's an image
UI is always on top of sprites
does that mean i can't put my sprite on top
google "put sprite renderer on top of ui unity"
alright
i've been trying
i still can't
the only thing stopping me from making my game is a stupid music note
Hi, my button isn't reacting to clicks or hovering. I tried looking it up online, but nothing helped. I thought it may be because an input field is blocking it, but I don't think it's that, because when I disabled it it still doesn't work. Any help would be appreciated
i've been trying to get this on top of my background for 2 hours
i have tried everything
and nothing work even a bit
Select your event system and you can see see what is hovered @tranquil estuary
Why not just make the music note a UI image @hollow scroll?
i'm an idiot i haven't tried it now it works thank you !
use SortingLayers
Hello folks, I’m currently going absolutely insane on an issue that just started popping without me interacting with it in any form (at least I think)
The callback OnPointerExit is called on my Monobehaviour (that implements IPointerExitHandler) when the pointer is inside and not moving. I’ve used a breakpoint to see what the PointerEventData thinks I’ve just entered and it appears to be… the very same game object I was already in. How ???
I made sure to disable the RaycastTarget field on everything on top of that gameobject, add an empty image on it (it’s a button). But it was working fine yesterday when I havn’t made all these changes. The only thing I’ve done between yesterday and today is writing some code for ScriptableObjects GameEvent, and I haven’t put any in my scene yet…
Even crazier : even though the PointerEventData tells me I’ve entered the same GameObject, it does NOT raise OnPointerEnter
public void OnPointerEnter(PointerEventData _eventData)
{
this.Log("OnPointerEnter " + gameObject.GetInstanceID(), "UI");
Activate(true);
}
public void OnPointerExit(PointerEventData _eventData)
{
this.Log("OnPointerExit " + gameObject.GetInstanceID() + " --- Entered: " + _eventData.pointerEnter.GetInstanceID(), "UI");
Activate(false);
}
The delay between the PointerEnter et PointerExit seems to be random but stays under two seconds
Simplify test, remove all possible interference. Perhaps try to replicate on a new scene.
Good point, I’ll try this
Also, from what understand the pointerEnter gameobject does not refer to a supposedly newly entered gameobject
edit: it works properly in an isolated environment, this is when I thank myself for having proper losely coupled architecture
I’ll go down the bughole and keep you updated
Hi, I am not able to make my UI, scale properly with different screens and its driving my crazy. Any ideas?
Seems like my bug has hit other developpers too
Ok well I applied the fix without searching more
does it change if you make it bigger?
might be you just seen the border right now
size of width and height op 0.1 might be a issue
oh yeah thats the problem
thanks
I still need it to be 0.1 though I know its annoying but I can't just change the canvas size
ah pixels per unit multiplier fixed it :)
I have another issue, this should be draggable but it just disappears
@real arch
with a left click
In this part of the Unity inventory tutorial I show how to implement Drag & Drop operations for the UI by using C# scripts.
See my social profiles here
G+: https://plus.google.com/+JayAnAm
Twitter: https://twitter.com/jayanamgames
Facebook: https://www.facebook.com/jayanamgames
Patreon: https://www.patreon.com/jayanam
Production Music courtesy...
I followed this tutorial
the border code only runs once and the drag code doesn't work properly
border code is just to get the green highlight
are you sure that setting the object position to mouse position is the right thing?
mouse position is in screen space
the object position is in world space
thats just what the tutorial said
log the values of the mouse in the on drag event and see what happens if you try to move the object there and if that makes sense
Need to make sure your canvas is set up the same way theirs is
(which isn't covered in that particular video)
how do i hide a canvas object from the scene view?
Hello! A question regarding script, text and UI . Basically I'm importing files from my local drive into unity and displaying those file names. The problem I'm having is all files taken from the folder on the local drive are displayed on top of each other, only showing the last entry in the UI. What I want to do is arrange each file name vertically ( below each other like a shopping list ). How do I make each file name appear on a separate line? I can add script if it will help.
the above is at run time
Hi, how to make UI Mask work if canvas in render mode - "screen space - camera".
Rect Mask 2D works, but i need circle
should work fine
how it is missbehaving?
mmm works in my test case
you did set the camera in the canvas?
Yep
all standard ui materials?
mmm wired
i cant recreate the issue
does a simple demo mask work in that scene?
try in a different canvas
does it work in a different scene?
that would be my steps to narrow it down
URP
URP 2019.4.13f1
works too
Thanks, i'll debug lil bit more 😦
oops the URP is not set give me a second
new urp project with the test case still works
have you tryed the minimal setup in and in a new scene?
@tired jay
Not yet, thanks for help, going to try.
Works on new project, 😅 😫
I have a character select for two or more players where the highlighted characters keep clipping into each other when displayed in their section of the screen. Is there a known way to sort of mask their cameras to fade the visibility of the model out of it exceeds a designated area of the screen?
Hi, quick question! I have a pause menu that darkens the screen, but not the rest of the UI. How can I make it darken the other canvasses as well?
Put it ahead of the other canvases?
Or put it on its own canvas with its own sorting layer
Define ahead 🤔
I put it physically closer to the camera but that didn't seem to do it
Lower it in the hierarchy window so that it's at the front of the canvas
the event camera isn't relevant - world space UI will still work without one assigned
Got an 'EventSystem' loaded?
Everything got Raycast Target enabled?
Nothing blocking the UI?
might be a collider too
What are you expecting to interact with? Just the mouse cursor? Or other stuff?
doesnt look like it
No, colliders are not required
interacting with cursor
menu looks like this in game
Looks like there are 3 UI canvases
The button animations for highlighting wont work either, which tells me the UI just cant see my cursor at all
I assume 3 is the UI you want to interact with, 1 and 2 could be blocking
The big one is to make the game look low res which i wanted to make the UI world space to also have the same pixelated effect
no idea whats in front of the camera
Oh found it, its the score UI to display the score in the game
it shouldnt be blocking anything
It shouldn't but it could be
disable 1 and 2 to test
If it's enabled, then it will be able to block raycasts, meaning the pointer events can't get past from your cursor to the UI you want to interact with
I disabled the 1 and noting changed. The 2 large one renders the whole game, cant see anything without it
disabled the main 2 canvas and the pause menu wont show up without it
just a black screen as i expected
the camera renders the game through it
maybe. The whole purpose was i wanted the UI to be effected by the render texture
Yeah, it's not simple to have it the way you have
pointer events don't hit the render texture and get passed to the UI elements
ah
Hey :)
I have a interface where i need to house 68 buttons in a circle. and because of the canvas size and read ability its not super easy so i decided to use a hover effect.
my hover effect however is getting cut off by the surrounding buttons. ( see video included )
how can i make sure my hover effect is always on top?
my script is simple as can be .
when it comes to UI, if you want it to appear on top of other UI, move it to the bottom of the hierarchy
hey thanks. i am trying a few things as well on the sideline. would something like this make it work?
try it
hmm seems to work. thanks for the encouragement @sterile wedge 
For future reference, that solution won't work if you're using a layout group
How can i make a hollow square with size scaling with transform size but the walls stay the same thickness?
in world canvas
slice the texture
look into 9 slicing
I have a panel on wich I added a scroll rect, but when I scroll down, it just gets back, how do I make it stay where you scroll?
the contect rect needs to be the size of the content
currently, it's not.. it's the size of 3 rows
does the same
You changed the size of this? It's too small, so this deffinitely needs the height changed to the size of the content
It needs to be the size of the child elements, not the size of the parent
how do i know the size if I cant see them, in the tutorial I've used he used the size of the panel, not the size of my elements
you've either misunderstood him, or he's wrong
turn the mask off ... or use a contentsize fitter on the content object
it's probably the sprite being used has them
and i really don't know how to place my button without being blind on scene view
select the canvas -> press 'f' with your cursor over the scene view
alright thanks
i left the scene and came back and now the whole background overlapped the scene...
nvm i made it work !
thx bro
what icon fits a button that shows credits of the creators?
Company logo
is there a way to increase mesh bounds? i made a script that curves UI and now i get loads of errors that the mesh is out of bounds
(text mesh pro) for some reason expecially numbers seems to be aligned very oddly vertically. it's aligned "middle" but still numbers are here and there
Pretty sure that's just how the font is made
Oh thanks a lot. That was it. Downloaded the font from Google Fonts so didn't expect they would make such horrible font 😄 (fixed by downloading better font)
Second question. Unity is crying me about shader channels that are not needed so I'd like to get rid of them but unity doesn't seems to allow that. When I disable those, save the scene and reopen the scene, those gets back where they were and I get the *warning again. Not a big deal but annoying. Should I report a bug or is there some specific reason for that weird behaviour?
Should i use 16:9 or full hd when doing UI stuff ?
I usually use full hd to make the UI look crisp on scene view but sometimes I use free aspect too to help making the UI to work on any aspect ratio/resolution
Yeah im confused of what i should use that fits best for regular computer minitors
you should design the UI so it works on any monitor (using Scale With Screen Size option and anchors)
Using free aspect whilst designing and doing the layout for your UI is a bad thing to do
sure use it to test.. but it's not a good test
Set the scene view to 16:9, set the canvas scalar to 'Scale with Screen Size' and set the 'Reference Resolution' of it to whatever your designs are (I usually go with 1920x1080).
I don't disagree with that but why is it bad thing to use free aspect?
Yeah and why do i need scale with screen size if i use 16:9 on game view?
you need scale with screen size so your UI scales according to the screen size and not resolution. If you use constant pixel size, your UIs gets smaller (relative to the screen) if you use same aspect ratio but bigger resolution
And why is free aspect bad?
You should be importing your UI elements to scale based on a specific resolution. By setting your game window to the same resolution and the canvas reference resolution to the same, you'll be able to place the elements exactly where they belong.
Free aspect is a ratio/ resolution that will never be used by a player
Hi, I'm trying to implement multiple UI screens by deactivating and activating buttons for each screen. When I change to another "screen" (which is just set of newly activated gameobject buttons) I cannot navigate and press any of the buttons. Any tips why this doesn't work? Is it even a good way to switch between UI "screens"? I'm using a gamepad by the way.
You need to set the 'active' selectable in the event system when switching canvases
this doesnt matter with a mouse , but with a gamepad it will
do you mean "first selected" ? @low pike - Going to try this, thank you!
not first selected
that'll only work first time you enable it
Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
Thanks again @low pike , going to take a look 👍
my buttons stay like if they were being pressed , i forgot how to fix this
maybe navigation. Try to disable it for those buttons
Hello guy i need help for do a clean multiplayer selection car
but when i put horizontal it make me this
But i want to have her
Is anyone firm with the native keyboard on iOS and how to style it? I am currently getting an ugly black bar over the keyboard with big size fonts. Not sure where this is coming form.
Okay looks like you cant
you talk to me ?
nope, to my own issue 😄
About your issue, do you have horizontal layout group there?
i create a game object
but he dont respect me
i want this
You dont answer my question, How did you set it up?
i dont setup this :c
i have created a canva
and i have reduced the canva
and i but the charcter selection into
and i put a horizontal layer group
That is what setting up means. You setup the canvas, the selection and layergroup. On your layer group, you can align the children to middle center.
You need to block the raycast with your overlaying canvas
Your image, the dialogue box is visually above your box, but the image component of it does not block raycasts, right?
There is an option on the component
yes
So this will block any raycast from passing through objects behind it
It should be turned on. You sure the dialogue box is above the button?
Hm, I dont have any issues with TMP
Can you help me please :c
how ?
i need to create an another canvas ?
but how the guys doing this ?
You should watch some UI tutorials or read some blog posts to understand the basics
So can you explain the hierarchy. YOu have a
-> Box as Button
-> Overlay with textmeshpro on it, anything else?
That's a setting on the TMP input component
Be honest, you uploaded a loading gif of discord to confuse me! 😄
This is just hiding it, I wanted to style it, like the color or font being used. But thats not possible still. So I gotta calculate and add my own input field here, sadly
I don't think you can , but i've not looked into editing it
Maybe you can though, Clash Royal does IIRC
Yeah I just checked, from docs, this is all we have. Hide the field and call your own without input on top and the just put your UI input on top of this with calculated height
effort++