#📲┃ui-ux
1 messages · Page 28 of 1
When I get home I could probably show the settings both in the panel with the text and the empty gameobject that contains the panel with both having vertical layout groups and the panel having a content size fitter
Try testing on a clean scene with default font for starters.
Default asset/text does not have monospace offsets
Then compare and figure out what's different in your setup.
Scene view:
Game view:
wtf
The text has the same settings as other text on the same canvas that looks fine
I copy pasted the other text to the location of this text and it looks like this as well. Same canvas though, and it and all parents have scale of 1. And all fonts look blocky like this
OMG nevermind, a parent had a z scale of 0
which apparently does that
You should make the fill a child of the border, or vice verse if you prefer. Then, set the child to scale with it.
Woudl this channel be an appropriate palce for font related questions?
I want to use the auto size feature with tmp, but it resizes the panel parent. Is there a way to make it not do that? I used Unity 6 preview
Hello, I need to have heart bar, and if my players takes damage, hearts change into empty one, but mine doesnt work at all.
Maybe somebody could help me out?
If you show your code and explain your object hierarchy/setup and explain what's going wrong, someone might be able to help you.
i will wait.
what is the best way to share it?
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Health : MonoBehaviour
{
public int lives = 3; // Pradinis gyvybių skaičius
public Image[] hearts;
public Sprite heartFull;
public Sprite heartEmpty;
void Start()
{
UpdateHearts();
}
public void LoseLife(int damage)
{
lives -= damage;
Debug.Log("Gyvybės liko: " + lives);
if (lives <= 0)
{
Debug.Log("Žaidėjas mirė!");
gameObject.SetActive(false); // Pasleps žaideja kai mirs
}
}
void UpdateHearts()
{
for (int i = 0; i < hearts.Length; i++)
{
if (i < lives)
{
hearts[i].sprite = heartFull; // Nustato pilną širdelę
}
else
{
hearts[i].sprite = heartEmpty; // Nustato tuščią širdelę
}
}
}
}
you're only ever running UpdateHearts in Start
you need to run it every time LoseLife runs
e.g.
public void LoseLife(int damage)
{
lives -= damage;
UpdateHearts();```
Why cant I see my Particals in my Game?
Maybe they're behind the camera
Particles do not render on the canvas iirc
hello i have a problem, when i move the achievement and go full screen the achievement just go higher than i put ithttps://cdn.discordapp.com/attachments/497872424281440267/1301207932121382985/20241030-1533-52.0992303.mp4?ex=6723a3d2&is=67225252&hm=753ba05cd146cf7913d7b8b9df6f189abe1f5fc50b4fa0b52f50bca1fb6a5783&
heh, I told you the problem ;p
yea but still, i dont know what to do
anchor it to the bottom right
also, when you're editing UI.. press T and use the UI tools
hey yall, how would I go about attaching a minimap to the player wrist in VR ? Ive been watching the below tutorial and all they did was drag it under the left controller (parent it?) and he was able to fiddle with it in the editor. When I did it tho, it doesnt show up once the game runs.
oh yeah tutorial: https://www.youtube.com/watch?v=YISa0PvQTGk
Drag "it"? You'd have to explain what they used
And what you tried
anyone knows why the UI profiler doesnt show preview for batches?
made a dummy canvas with default images , here Batch 0 , still no preview
oooh, could it be that URP isn't supported ?
there's an issue tracker at https://issuetracker.unity3d.com/issues/ugui-profiler-no-preview-is-displayed-for-ui-profiler-objects but it says its been solved, yet its still hapening..
I have an issue that ONLY happens on Mac. We have defined a default cursor, and it falls back to the system cursor randomly after a few seconds. If I alt-tab out and back in the game, or move the mouse to another screen and back to the game screen, the cursor comes back. Happens on single screen as wel (so unrelated to the multi screen setup).
Can't you set the cursor every frame?
It's not that slow performance-wise
that really feels like an overkill solution. I guess if it's negligible I could do it, but it feels to me like treating a symptom rather than its cause.
if the OnFocus event works, you can use that, but I doubt it works
Besides, the cursor setter probably does checks internally to avoid setting the same icon over and over anyway
What version of Unity are you using?
There's this bug, that's been fixed, that is sort of similar so your issue could be connected to it and solved by the bug fix...
Reproduction steps: 1. Open the attached "PROJECTFILE" project 2. Build And Run the project (File > Build And Run) 3. Observe the...
anyone jknow why all my text just broke
lol, fs
what
oh, i mean like im not sure what i'm meant to debug here. no errors are popping up, and it wasnt an issue before
just happened out of nowhere
there's no debugging, it's not code related
You need to trouble shoot it.. and we cannot help with that if you don't show anything
every time I undo, this error shows up, could be something to do with it
unrelated
i mean it could be if it has to do with the renderer?
Doubt it's the cause of this issue, but go fix that first I guess
the volume profile is for post processing
global settings does quite a few things
the atlas looks broken
ok
thats probably it
every font but liberationsans seems to work
sorry i mean
the other way around
the only working fonts are liberation sans
okay, i imported TMPro essentials and its fixed
When I've not had the essentials imported the text just hasn't shown at all for me
It's just another gameobject that you set the position of.. by either changing the .anchoredPosition or set it as a child and zero out the .anchoredPosition
How can I fix this?
I mean, I'm a bit confused, what checkbox is for what name exactly, because "StandingPlace_LargeHitbox" and "StandingPlace_SmallHitbox" are both highlighted:
How can I adjust the position of the Text and the highlight in there, so they are directly on top of every checkbox and not shifted so strangely?
go through the layer names and make sure none of them have any carraige returns or blank space
to work out which row is which text... count
Do you mean empty text boxes or spacebar between words?
Nope, not a single spacebar in there.
Its really weird, it behaves different in Unity 6000.0.24 than in Unity 2022.3.22.
It's not weird, it's obviously a bug 😂
Left Image Is Unity 6000.0.24
Right Image is Unity 2022.3.22
You don't see it if there are 0nly 5 layers in the beginning, but the more you add, the more they shift.
Is it fixed in 6000.0.25 with this realese note?
Or does it mean something else?
Physics
6000.0.25f1
Fixed a race condition inside Physics Debugger's contacts tab. Where the underlying contacts array would be incorrectly passed onto new jobs while still in use inside the previous set of contacts display jobs. ```
This is obviously not the physics debugger.
nor an array
So, not worth testing Version 25 just for this only fix in category "Physics" ?
https://alpha.release-notes.ds.unity3d.com/search?fromVersion=6000.0.25f1&toVersion=6000.0.25f1
If you only knew...
update/ don't update.. whatever.. report the bug and move on
you're wasting your time on something you can't fix , instead of doing actual development
Already doing.
but how do I like get the objects to scan? like if I move left how do I know what to move to? or up and down
if there it's mouse, then IPointerEnter / Exit
if it's a controller - then use the navigation thing. You know what is selected because you're selecting the character to choose to play as
do I make each little card a Selectable thing? idk how else to make an object selectable. what if there are multiple cursors for a local match, for example? I'm pretty sure you can only have one event system
you're gonna have to google this
Is there a way to get the nearest selectable relative to another in screen space?
for example, i have a selectable button that refreshes a list of servers. is there a method i can call in order to dynamically switch between said button, and the newly populated UI elements below it, without depending on hierarchal structure?
i understand selectables have a Selectable.FindSelectableOn(up,down,left,right), But i cant seem to get it to play correctly
the list of servers are a child of something? could probably just use transform.GetChild(0);
somewhat related to UI, but I'm having an issue where this particular asset keeps changing
not related to Unity UI at all.. this is for game UI, not editor (or git client) UI
just discard it all the time
it's a textmeshpro asset
it would be helpful to know what's causing it
look at the diff and see what's changing
no idea what's changing and what is causing it, it's seems like a bunch of binary and other data
1000+ lines of this essentially
did you google?
of course..
99% of people come here and don't..
I found a veeery long answer here but it doesn't seem to answer the question
https://discussions.unity.com/t/textmeshpro-font-asset-keeps-changing-in-source-control-despite-not-editing-it/754628/6
He's the dev of TMP.. reply to that post
yeah actually youre cooking with that
was curious if there was a screenspace optin
How to calculate the minimum, and preferred height and width of a specific ui game object?
Regarding my message earlier, wouldn't there be a simpler way to do this using masking? I'm trying to do a workaround with a second camera, but my cameras seem to just be fighting for rendering dominance right now
Mornin' all, having a weird issue that I can't figure out.
Can anyone see from the current setup as to why my buttons aren't receiving mouse button clicks in game please? Little bit confused. 😕
That's a non-standard hierarchy but I don't see the event system there
what does mean width & height of TMP object?
The event system is in there (it's up top somewhere. Using Hierarchy Designer)
Oh balls. I just figured it out, my bad. I'm using a 'mouse controller' that's all raycast driven and that was interfering.
so I have two canvases. On each I have a button which goes above another button on the other canvas
but I can't click on the button on top even if the other canvas is disabled
how come
guys I need some advice while creating a game UI anyone plzzzzzzzzzz
Check if GraphicRaycaster is attached to the Canvas.
already sovled nvm
That's not a question
for example, I have a picture that fills the entire screen, and there are buttons under it on a layer below, and how can I make these buttons clickable???
there is supposed to be text at the top of my dialogue stating the name of the NPC ypu're talking to but it's empty? it was working a second ago but it's not now. The text object is active and there is text inside of it as well. what's wrong?
Use UI buttons.
Not sure I understand the question fully.
maybe it's behind something
maybe it's not in the right position
Alright! Let's break this down as simply as possible:
Imagine you have a big picture on your screen. This picture is covering everything, including some buttons that are hiding underneath it.
If you want to be able to touch those hidden buttons, you need to either:
- Make a hole in the picture where each button is, so you can reach the buttons through those holes.
OR
- Tell the picture to ignore touches, so when you press on it, it doesn't stop you from pressing what's behind it.
In Unity, for example, you can do this by changing the settings on the picture so it doesn’t block the buttons underneath it from being pressed!
(chat gpt used)
So are you telling me something or asking me something
asking
what are you asking
you just want the image to not block the clicks?
disable Raycast Target on it.
yes
thank
im pretty sure its in the right position as in the editor it is where i want it to be and im pretty sure it isn't behind anything as it is on top of everything i want it to be in the hierachy and changing the poz z didn't solve it either
nvm this has been solved
i can give some advice. use textmeshpro
soo, does this line over here is just line render that track pos index 0 from the source and index 1 to targeted object(since it follow the y pos of the HP bar)? or is there any UI feature that does this and i missed it
Zenless Zone Zero Gameplay Walkthrough of Dead End Butcher Boss Fight using the Male MC Wise in ZZZ with No Commentary on PC & PS5.
Zenless Zone Zero is an upcoming free-to-play urban fantasy action role-playing game developed and published by miHoYo in mainland China, with global publishing by Cognosphere, d/b/a HoYoverse. Zenless Zone Zero is...
Could be, could also be just a normal and rotated image
Is this game made with Unity? The visuals are impressive
yup, it made by unity china version tho, so it's heavily modified version by Mihoyo
thanks, going to try the line render first and see the result
@ancient vapor Full context: I'm debating whether it's worth developing an AI asset that prototypes and iterates on Unity UI based on user input
that led to wanting to check out the current state of the art -- what's been achieved so far. And I didn't find any assets in the asset store that do that
thus I asked about what others have seen or heard of 😛
But right now it sounds like too much work to develop something that would do simple stuff.
you are correct it would be to much work for such a simple problem, I would not call it AI rather UI generation as it requires user input to work and will not do it itself, you could make a script that randomly generates UI based off of percentage or chance but I do not know how good that would look
since it would be randomized 🤷♂️
hmm.. have you ever asked ChatGPT for example to generate code for a website or something? It's pretty good at designing UI stuff.
I'm guessing people have never created such things because it is not really necessary for UI
well it depends on the sources it has gotten really
but it's only good at html/css etc haha, Unity is much more complex for it to work with, since it normally involves right click --> create GameObject --> set it up from the inspector
yeah I think that's the case
it gives some absolute horrifying code most of the time 🤮
true it's terrible at C#, much more in Unity 😆
that's probably because people on the internet have zilch of what they are doing 😁
I need some help with one part of my UI refusing to resize to fit all the children. My current hierachy of gameobjects are:
- Audio Clips (Scroll Rect, content=Content, vertical)
- - Content (Scroll Rect, content=Tracks, horizontal), (Content Size Fitter, both preferred size)
- - - Tracks (Content Size Fitter, both preferred size), (Vertical Layout Group)
- - - - Clip Bar (Layout Element, min width = 1320, preferred height = 200)
- - - Panels (unrelated, but needs to scroll vertically along with Tracks)
At runtime there can be 0 to infinite clip bars on scene at once. The Tracks object is scaling correctly to fit all the clip bars, but Content refuses to change its size from (0, 0). How do I get Content to rescale to fit all of Tracks?
Hello!
I am trying to make this for an UI
here's the video: https://www.youtube.com/watch?v=YtAR1qYU6zU
In here, when the player hovers on the weapon, it shows a video of what the weapon does
I am trying to achieve this and I do not know the best way to do it
in my game I want this to show pieces, around 30 or 40
should I just record it one by one in a GIF or is it better to use Render textures?
thank you in advance!
Is it possible to exclude some UI Elements from Post Processing? The Canva is in camera space
Render it on a different camera
Or use an overlay canvas
I've tried rendering it on a different camera, but it's not working.
I seperated the UI elements into another layer, but the post still affected the whole scene.
Maybe it doesn't work because of camera is in the canvas camera space section?
I do set it in camera space for the 3D look, overlay would remove this effect.
You'll have to also put the UI on a different layer, and exclude that layer from PP/ the non-UI camera
quick question is there a way in unity to make some kind of posititioning so i can put it right on middle?
anybody know how to replicate the background effect from deltarune during the opening character creation? Video for reference: https://www.youtube.com/watch?v=R278lYnkfko
are there any downsides/upsides to text mesh pro? or should i just use normal text components
TextMeshPro is the normal/default text component
Text is legacy
Not being able to use SVGs for UI icons is a pain for scalable UI. There was an asset in development but looked a bit clunky.
Hey, I wanted to add an outline to the current text. However, it looks really weird on a light background. In addition to the outline of the letters, their square surface is also colored. Does anyone know how to remove this? Do I need to change something in the font itself?
Yes, increasing the padding helped. Thanks ^^
Can anyone help me make sense of this bug where one button's events are affecting another button?
Most likely cause is that the rect for the button getting the events is big enough to cover the other one.
If you want further help.. actually provide information about the setup, so that we don't have to guess 🙂
I figured it out~~ and basically confirmed it to be a Unity bug.~~
If I re-add the button component, then the color API calls work as expected. As soon as I copy the component values from the trash button, it then starts applying all of the check-button's color API calls to the trash button.
copying values from one button to another will assign the image to change the colour of ... doesn't sound like a bug
I tried using TMPro with pixel font, but when i use outline effect its almost imposible to see, any way to fix it?
"Jump" uses clasic Text component and outline
Which outline effect are you trying to use on the TMP?
target graphic
You are right. Thanks.
Hey everyone! 👋
I'm building a WebXR portfolio to showcase my Unity and XR skills, and I’m currently experimenting with the menu design (screenshot attached).
Any feedback or tips on how to improve it? Also, if you know good places for design inspiration, I'd love some recommendations! Thanks! 😊
maybe make the information bigger when selected just like how it is with the buttons on the top. or make the grey hover background fade. or make the icons animated when hovered, like the sheets of paper going more on top of each other
I want a back button on my UI for my mobile game, but I don't know where I should put it, does anybody have a suggestion?
the text is Dutch
Is there a way I could force an aspect ratio? My game is designed for 16:9, but when I am testing things out on a steamdeck, it's becoming 16:10, and my UI is being placed in strange ways.
Just curious to know if I can do something -- I checked this option but the issue still persists:
The best option is to make your UI work at different aspect ratios.
Second best option is letterboxing
okay I think that should be enough for a start 😄
what do you think 😄
wow! amazing!
I made this UnityGifImageAnimator for it also and thought it might come in handy for others too! Maybe it’ll help! 😄
📷 GitHub: https://github.com/freddynewton/UnityGifImageAnimator
how can i fix richtext tags jitter when i display my dialogue?
https://gyazo.com/f18d3f57eb8adef700199358fe1b337a
Use maxVisibleCharacters for the effect instead
Ah yes makes sense!! I went ahead and just changed them to work both on 16:9 and 16:10 — wasn’t too much work thankfully
Appreciate the heads up!! 😃😃
i have a 2d ui with img & text on the same place
i don't see the text
how 2 make it visible? when i drag it from image i see it
Hard to answer without seeing what's going on. Presumably you just haven't positioned things properly
Or you're using the wrong components
What components are you using?
What's the hierarchy order?
UI elements are ordered by hierarchy order
Lower in the hierarchy gets drawn on top
But you have to make sure they're actually both UI elements and on the same canvas for that to work
The image is below in the hierarchy
As I mentioned, things below are drawn on top
thx
Hi guys, i have a probleme with the UI in the scene its like its flipped but in game its ok but i have a line in the middle
Wdym by flipped
You don't see the line in the middle
its mean its the back of the panel
but i look on the front
But my canvas is not flipped and same for the panel and the text
i have an image, how 2 use it in 2d ui?
Import it as a sprite and use it with the Image component
how 2 import as asset?
You mean as sprite? Just change it to sprite in the import settings
downgraded to 2022 and my text is gone
Any good asset store packages or tutorials etc that teaches industry ways to handle mobile reward flyouts/flyoffs? Is it called something different? Not finding much out there.
fixed it
Not saying a complete tutorial, just like a way I can make something close to how the buttons look
Cause I don't know if its actually a 3d object with a button component, or if it's a ui mask or something
i don't see import settings?
Just click on the asset
Look at the inspector
does anyone know what this selection system is called?
i made it by saving current selected, unselecting it & select clicked in script. if unity has built-in system for this idk
this would be for multiple controllers though
Character selection screen
Hi yall! I just joing this server to just ask this question but I need help with importing packages from github to unity.
anyone able to help?
Just ask the question and if someone knows they'll answer. But this is the wrong channel, use #💻┃unity-talk
Thanks!
hey, I'm trying to make an overlay that obstructs ui to prevent it from being clicked
i created a rawimage (also tested with image) that goes on top of ui with the raycast target box checked
the color is set to black slightly transparent
the issue is that I can still click a UnityEngine.UI.Button that's behind, is that an expected result?
The UI Button I'm trying to block is inside Menu Canvas
(I've tried putting it both under and above in the hierarchy)
UI is drawn in hierarchy order - from top (first) to bottom (last) .. your blocker isn't on top of anything
so if they are on the same level in hierarchy, they can 't be above or below one another?
it isn't possible to have anything on the same level in the heirarchy
So my global canvas should be on top of my main menu canvas then?
If you want the 'Raycast Blocker' to block things on the 'Menu Canvas' then yes.
That's what I thought too.. yet it's not working somehow
'somehow' == because you've not got ti setup right 😄
Does global canvas have a graphics raycaster on it.
if it has a canvas group on it, are the tick boxes endabled?
are both canvases on the order 0? (on canvas component)
ah forgot about that, tyvm!
sort order i set to 999 just to be safe
I don't think this matters then .. use the sort order to say which canvas is in front of the other. The hierarchy ordering is for the children of that canvas
is there a way to fake perspective in UI?
the first one is with screenspace camera, and the second is without.
Postprocessing is one way
screen space camera looks good but if im too close to a wall, it gets obscured by the wall
so i want to use overlay, but then the effect is lost.
You could draw the UI on a secondary overlay camera
oo interesting, how would i get that overlaid on the main camera?
or like
drawn to the screen
Just set up an overlay camera
And use the culling masks on the cameras to determine what each one sees
Okay i've created an overlay camera that can only see the UI layer, and the main camera can see everything, but i can't see the UI. the hovering is still audible, so its there, but i can't see it. what have i done wrong?
wait i fixed it
i added it to the camera stack
i'm trying to make a scrolling marquee text. I have this thing that works in a overlay space, but in a world space, it doesnt seem to show any text.
look on the other side
it's the right way
nvm i fixed my problem
In future things to check (and share... so that we don't have to go through each thing..)
- it's facing the right way
- colour, make sure alpha isn't 0
- no canvas groups are set to alpha 0
- alignment
- everything is enabled
okay, thanks!
hi im trying to link my button to a method in my script but for some reason its not detecting the method
its already linked to the object
!code
📃 Large Code Blocks
Use links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/, https://paste.myst.rs/, https://hastebin.com/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
this is the code for the method
oh nvm i figured it out
hi i managed to link the button but for some reason i cannot click on it or use the textinputfield
things to check
- is anything blocking them
- have you got an active event system in the scene
- is there a canvas group present (on itself or any of the parent objects) and are the two interactable box ticked
- is there a graphics caster on the canvas game object
- are you using the new input sytem? -> If so I believe the setup is different for interacting with UI..
oh yea it was the event system thank you for the help
i accidentally deleted it from the hierarchy
i have an issue with my canvas drawing behind the game geometry (clipping)
here's my global canvas, the camera is set to the same one that draws the geometry like this
yet, it's draw under the geometry, thoughts?
wish i could just use an overlay canvas but it breaks the ui sprites in my canvas (invisible in play mode)
you've two choices.
- lower the plane distance on the screen space - camera canvas
- use Overlay and fix the issue
hii, I was trying to make a text in Unity with this kind of stylization by using TextMesh Pro but found out it being a bit hard than it should be since the outline was getting inside the text and I couldn't move the offset of the outline... what's the best recommendation to recreate something like this?
yeah, i guess there's no reason not to have a super low plane distance?
Unsure of the answer to that, I've never used screenspace camera
I do not believe there's a built in way to do this. The solution is either to write your own shader or buy one
OR do it a hacky way and have an additional TMP underneath, slightly offset to create the shadow
yheea I was planning on trying to do my own shader or script to be able to do it
what's in an inventory bar?
inventory bar contains a couple inventoryslot prefabs
which looks like this
the white square is an image, I just put it like that because I was debugging
yeah, the buttons just spill out
ok, thanks for trying to help, I think I may know where to look
I got it. for the horizontal layout group, Control Child Size defaults to true in-game, and defaults to false in editor
I just have to explicitly set it in code for it to work as expected
wow 💀 what a stupid thing to lose a lot of time over
to make sure it fits most screens, should i be setting it to the scaling id expect people to use or the reference resolution to the smallest one possible?
because my screen is 1920 x 1080
ive never really understood how im supposed to do this part
i dont understand...
okay i should be testing out the UI on the Full HD option, right?
because thats what my reference resolution is set to?
im just going to do that from now on
im trying to mess with text stuff, but i keep getting these errors. how do i fix this?
Anyone know the proper way to activate and deactivate an input field for controller support?
I really hate pressing submit twice to deselect it
I want to be able to call DeactivateInputField() and go back to the selected, but none interacting state
If that makes sense
Seems simple but can't for the life of me figure out what I need to call
Yes, never setup UI while the game view is in 'free aspect'
Im going to guess that Unity hasnt fixed this yet, last post i read is from 9 years ago
9 years and we still presumably need to use a wrapper for inputfields is crazy
Thoughts on this as a Turn Order Tracker for a turn based game?
Not sure what kind of game it is. If it's a game where players have multiple units, it might make it easier for players to track their order if you add some visual representation of the unit's ownership (e.g. a strip in its team's color).
For TMP text assets is there any way to make the "Italic style" less than 15? Or am I gonna have to use something else to make it that
does it not depend on the font ?
i've been trying for like 3 hours to make my ui elements layer over tilemaps and so far i have not been sucessful
how would i achieve this?
also how do you order ui elements in layers
My pause menu buttons are not pressing. I've disabled every other graphics raycaster and every other canvas, but highlighting is still not working 😭 in a scene by itself, the buttons do work, so im not certain whats happening here
what else would block scanning like that?
I don't see an event system?
Use an overlay canvas, or a screen space camera canvas with a plane distance smaller than the distance from your camera to the tilemap
or - draw that UI on a stacked camera
fixed both of my issues, TY!!!!
I design ui
there is not one, i didnt realise. thank you!
anyone know how to fix this issue where when i try set the render mode of the canvas to the screen space camera, it comes up as black. i'm trying to get it so the UI also renders in a lower pixel size(?)
the game objects renders in a lower texture but not the ui
Camera space is a world space fixed to a camera. Your camera parented to a character and default plane distance is 100, placing UI far behind the character. Make sure it's between the character and the camera or render it with different camera.
Tysm I’ll give it a try once I’m back
Hi there (moved message)
just wanted to ask, how do y'all ensure UI navigation when switching between Mouse & Controller inputs?
I can not seem to combine a panel with horizontal layout, with a shadow, properly. Because the panel auto lays out depending on when I hide or show children but then the shadow does not always scale to fit. Probably because I can not see how to do it without 2 content size fitters - 1 to control panel and one to size shadow (which is the parent)
ah seems you set first layout group to control child size and remove child content size fitter. It is not easy to understand!
can any one explain why tmpro text is doing this on run time but not in the editor
driving me crazy
Some text in the background seems to work. Does it have a different font or material?
text mesh in the background, and different font as i read something about the materials conflicting
if i forget screen space, theres no issue either
Never mind, i have found the issue. UI element scale is setting to 0 on the Z axis at run time, seems to be the issue, but not sure why lol
How can I make sure that the "Pixels Per Unit Multiplier" scales to the current resolution? The edges get rounder and rounder the lower the resolution
Also, the items in the Vertical layout group don't scale. I want them to be perfectly square every time with the same spacing. Just the scale should change
If 9 slicing isn't working properly it's usually because you've scaled some object in the hiearchy instead of resizing it.
you should basically never touch the scale on UGUI RectTransforms unless you're doing something out of the ordinary
why doesnt this work for me? I am trying both mask and rect mask 2d
how can I get a callback for pressing enter inside an input field? end edit will call for when you click off. I just want it so enter does something
submitevent , maybe
Thank you for the response. I haven't scaled any of the RectTransforms. I think it's because it used pixels to determine the 9-slicing. The elements stretch to fit the resolution based on percentages of the screen they should take up, but the 9-slicing works in pixels. I just don't know how to fix it
Edit: Fixed
I have this image (discord logo), and i want to have it into my button, but when i drap and drop it in "Source Image" in the Image component it doesnt work
If someone can tell me what i did wrong
i still need help 😦
You have the 'Sprite Mode' set as 'Multiple', change it to 'Single'
hey I am having a problem with a scroll view where the content appears correct in the editor, but when I play the game it is always shifted left. Any UI experts that may know what my issue is? I can screenshare.
from the information provided, cant know for sure
I am not really sure what information I can provide thus I'd like to be able to screenshare with anyone that may have a few minutes.
no one is gonna screenshare
for a start.. show screenshots of the gameobjects that can affect the layout - the one you've chosen has no components on it
Desc is the first one
I have screenshared previously. And I have helped someone else with screenshare. it is very useful.
right, I see the issue now.. struggling with the size of the text on your images on my screen
Content is moving.. you've got it anchored weird
Yes, something is definitely off... I thought it might be the anchoring, but im just not getting it...
Anchor it to the top middle, put a vertical layout group on it and tell it to stretch to the size of the children
and then let's see what's on Viewport
k. is this the change you were looking for with the desc?
Here is the viewport
ok , nothing to change there
k. After testing with the vertical layout group on the desc gameobject it is still shifted left. Hmmm...
Check ALL the game objects up to diaglogue one and see if they move
I'm sorry. I am not understanding that direction. "Check"?
k. when I look in the hierarchy the first one to be placed incorrectly is the content.
It is shifted left and outside of the viewport
pls don't cut off info
you've still got that object pivot at the bottom, it should be at the top and anchored to 0,0
if you toggle the viewport off/on does the layout change
I think i have the content as you suggested now.
toggling the viewport off does not change the layout
I can't remember if anything references Content - look on scroll view and dialoguepanel for a link to content
I doubt it makes a difference in this case, but "never" change the scale of UI elements. Always resize with width/ height..
you've got the scale uniform, so it's probably ok.. but change it back to 1,1,1 and get the size correct with width/ height
hmmm... so yeah... if I want to hide the ui element then setting scale to 0 is not the way to go? I should use width/height?
for animating on/ off you can change the scale - lerp/ tweening between 0->1 .. that's fine
well, after wrestling with it for a while and implementing your suggestions I am able to get it to look correct in the editor and when playing in the editor. However, when I build to my android device the text is not correct.
this now becomes even more frustrating, because you cant see the inspector
Ok. Getting closer. I placed a vertical layout group component on the viewport and that seemed to get everything positioned correctly. Maybe you told me to do this? I had the vertical layout group on the Desc gameobject previously.
So this works much better for the horizontal positioning, but now the scroll bar starts at the bottom so you have to scroll up to see the content. need it to start at the top. Hmmm...
I said to put it on Content
Your pivots and anchors are (or were) all aligned at the bottom
Got it! Had to set the Y pivot on Content to 1. Seems to be working well now. Thank you for your time!
can you set a simple string by using the TextMeshProUGUI.text property? I keep trying and I'm getting nullRef exceptions
That's what it's for
If you're getting an NRE that would be for the typical reasons
You're trying to access a null reference
Whatever variable you're calling .text on is null
ok thanks. I wanted to make sure I wasn't going crazy or missing something obscure with how TMP works. I'll do another audit and see why it's nulling out
I did some research into other games I like for inspiration, and have been working on a mockup for my game's battle UI.
Thoughts on this setup? Too noisy? Anything seem out of place?
This is basically what you would see once your turn begins, before you open any menus or use any actions.
Specific Post-Processing + UI Issue regarding Chromatic Aberration
Why wont my textmeshpro text let me turn on outline or anything else? Its all grayed out
why would you share a screenshot of it without Outline expanded?
If I put an input field down but can't edit it in play mode, is there some setting or configuration I should be checking?
is it detecting your click?
It doesn't seem to be. The edit cursor doesn't appear.
check if you have an eventsystem in your scene (if you have anything else in your scene that is clickable and that works then this part is fine), the second cause might be that something else is covering it up. if you click on it without being in play mode, does it select it immediately or does it select something else? could be some text which has bounds that are too big and covering it up for example
No event system
you can create that easily with Create > Event System or something like that. in your hierarchy
ok cool
That did the trick. Thank you!
hiya
i've got a very specific problem
i'm using Lerps and Coroutines to transition menus in/out
and it all works great except for Color Alphas
basically i used to do this via Animator, i'm now doing it via code now
and it seems that in Image components, the Color component doesnt Lerp the Alpha value in the same way in Animator vs acessing its fields via code
basically i'm trying to lerp betwen 0/255 Alpha and 5/255 Alpha on a Color and in code it goes via steps (0, then 1, then 2, etc)
via Animator it smoothly interploates it from 0 to 5 and looks much better
is there a way to fix this? i cant just "scale the colors up" unfortunately
Show the code
i'm just using Color.Lerp
lerping on Time.unscaledDeltaTime and it works great for everything else than Color.Lerp
so i'm thinking it must be casting the Alpha to an int
Could be, but can't tell without seeing the code ¯_(ツ)_/¯
Not e that Color uses a float between 0 and 1, not 0 and 255
sup gang
I have this button, which for some reason I can't raycast it
everything else works except for 2 of my buttons
I tried removing and readding the button component, changing the objects parent but still nothing work
they don't even get highlighted
the pink button btw, I tried moving it around the screen and still
Does your scene have an event system?
yeah, it's probably because of my mask I think
cause I made the buttons a separate object from my scroll list and such~ and now they work 🤔 ... it's messy... I'm just happy it works XD
but I appreciate you coming to help ❤️ It works nicely
UI toolkit will replace UGUI?
Yes
i have a massive performance problem with a ui screen in my game.
It takes about 4 seconds and 277 drawcalls to open it, and i have no real clue how to fix that.
It seems that every single element is loaded piece by piece.
I created a video of the frame debugger while loading the ui.
This might help
https://unity.com/how-to/unity-ui-optimization-tips
ill have a look 🙂
Sadly nothing happened.
It seems that the initialisation of the UI is the problem.
It needs 4000ms to open the screen. When its opened, it runs at 10000fps ^^
could it be coming from your code? or is it just from the ui being enabled?
did you try using the profiler?
yeah, sure. The profiler says that:
we have a bunch of tooltips in this screen which are loaded
feels like initiating the TMP loads forever
well if you google this then you see a message from the creator of textmeshpro that says text autosize destroys your performance if you're using it on those objects, are you?
why does the text on the bottom right have a weird square around it?
using textmesh pro:
i have a text box for users to input messages, and recently after updating to unity 6 i notice this box at the end of the text. how can i disable it?
Do you have that if you create default new input field?
seemingly not, just tried
i should mention its only with text input fields and not normal text
then examine it and compare what creates that
have you looked at all the settings the textmeshpro input field has? through the inspector
i had looked through them but didnt notice anything out of the ordinary. i have to compare the fresh one to the old one. thanks both
How do you have those colors associated with the different tree branches in the scene view? :o
asset from the asset store
Yeah but like. What's the asset?
Im dyslexic and have an awful time telling scopes apart in the scene tree
search in the store 'hierarchy'
what?
ohhh
the hierarchy
it's $15
and this one is free
Hell yeah!
I have a GUIWindow that has a custom style, when not selecting the window, it draws the style properly (1st image), when selecting the window, it draws incorrectly (2nd image). How do i make it draw the exact same way both when selected and unselected?
Attention Width is the resource/meter which determines how many things you can focus on at once, so, for example, Summoning a minion will occupy some of your Attention Width, since you have to focus on commanding them, and maintaining a psychic grip on an enemy also takes up some of your Attention Width, since you have to focus on them the entire time you're doing it.
Attention Width is not permanently lost when doing this, but rather, limits how many "effects" you can have out at once.
Considering that, which conveys better, in your opinion:
Your Attention Width (Basically Focus Points) Fill up as you divide your focus among multiple things (The meter starts empty, and fills up as you summon more things)
Your Attention Width depletes as you divide your focus among multiple things. (So the meter starts full, and empties like any other resource)
Is there something you have to set to be able to add children to "content" of a scroll view
Set content to have Vertical Layout Group. And then added the two children maually as a test
and nada they aren't showing
How should I handle the situation where a user has the in-game menu open to adjust settings and they get disconnected from the host and kicked back out to the main menu? Should I leave the settings UI up until they close it? My concern is that if they are in the middle of changing something, it could be misleading whether or not their changes to effect
I please would like to ask for help regarding Fonts.
I need to use fonts that support English, Japanese, Simplified Chinese and Korean, and I have tracked down a couple of fonts to use, however because my App uses TMP, I need to convert a lot of those font files to SDF files, which causes a lot of the font data to get lost.
This results in a lot of Characters going missing.
So far, google has not been of much help.
Does anyone please know how I can convert normal font files to SDF files without Characters being lost, or perhaps know another way that I can properly use these fonts?
The nuclear option is that I completely remove TMP from the project and use the base UI elements that work with the original fonts, but that would most likely cause more problems than it would solve.
does anyone know why my prefab within a within prefab isnt displaying proply?
all Z pos should be 0 - it doesn't affect the draw order of UI, draw order goes off order in hierarchy from top (first) to bottom (last)
The Canvas component also has a 'draw order' field on it
I think you should make it somehow visible in the background that they were dropped, but keep the settings menu open until they close it
Any idea why the keyboard changes size when built?
nvm I figured it out, had canvas scaler set to 1
does anyone know how to put post processing on some items in a canvas?
im very new to ui in general but i want my post processing volume to affect these things but not the monitor which is supposed overlay ontop of it
anyone here got any ideas / tips how i can improve my UI? the combo thing is only on screen for 1 second after you kill an enemy
Don't use default font? Don't use solid bars that look placeholder?
You can use https://www.gameuidatabase.com/ for inspiration.
its not default font
ive tried to make it look clean and not super over the top
like the aethetic of the maps
i meant moreso layout
i just dont want it to be cluttered
any idea how I could improve this keyboard? it feels really clunky on mobile and I'm not sure why
https://www.youtube.com/watch?v=_SxB5xrLGhQ
anyone know how I could recreate the loading effect at the very start? where it like scratches through some iamge and then loads?
Compilation of all character victory animations in Super Smash Bros. Ultimate for the Nintendo Switch (DLC Included)
00:00 Mario
00:24 Donkey Kong
00:47 Link
01:09 Samus
01:29 Dark Samus
01:54 Yoshi
02:18 Kirby
02:36 Fox
02:57 Pikachu
03:18 Luigi
03:43 Ness
04:04 Captain Falcon
04:26 Jigglypuff
04:49 Peach
05:13 Daisy
05:38 Bowser
06:01 Ice Cli...
@honest herald let's move here, to the correct channel
If you add an image to the canvas is that visible?
let me try
if I do this I don't see anything in the headset, and in the scene I just see a blue circle instead of the image
the blue circle is the pivot
I wonder if either of the warnings you have on your canvas are the reason
fix them I guess
so I tried to fix it, this is weird, the warning goes away only if I put "nothing" on the additional shader channels. However, when I build the project, it automatically goes back to select a list of things:
and it still won't appear
(on the headset or in the scene)
select everything
I tried and built, it stayed at "everything" setting however still nothing on the headset, and the scene still has the blue circle
stop building, just get it working in editor first - building wont make a difference
"the blue circle" is the pivot.. the gizmo, it is supposed to be there and is only in the scene view
also, this is a screen space overlay canvas.. you will NEVER see anything in the headset. This type of canvas can't be used in VR... but you should still be seeing it in the scene view
I see, ok. So in order to see something in VR I should use something else than that screen space overlay canvas?
ok, now that I put it in screen space camera I can see that stuff in front of my nose, however I lost the rest (passthrough, transparent cube, etc). I think I must be close
Adobe Ae
I would use Ae and export it.
There is likely a better way but that how I do mine.
but export it how, i dont understand. waht are you exporting?
The after effects file
what is the after effects file for. what is the actual effect youre making in after effects
must be some kind of layer order thing. When I have the camera and canvas, I just don't see through with the passthrough anymore. I just get the background of unity (blue sky and brown earth)
or i am not sure what it can be
Yes. I make them in affect effects and export them to Unity
i dont think you understand my question
I don’t think you understand the answer
The fancy background stuff can be made in AE , exported into a format for Unity. Then you use it in Unity with the models and post processing.
what do you actually export, im confused. i assumed the screen fracture was like a shader or something
Hey there, I'm making a PSX style game, and I would like the canvas to match the low-resolution aesthetic of the rest of the game, however I'm not sure how to get the UI to kinda 'Scale down' if that makes sense.
For example, here's a picture of my scene: How would I get the text/ui to a lower resolution similar to the rest of the scene
How can i make the Image component shift the tiled sprite, like, animated?
Nvm i noiced if i change the size of the image the sprite shifts relative to the camera becouse it's computing the sprite from the corners so im just changing the size using:
Background.sizeDelta = new Vector2(3000, 2000 - (spriteSize * 2) + ((Time.time * 80) % (spriteSize * 2)));
which is enough for a shifting look
how can i make a scroll rect start at the bottom instead of the top?
You mean the scrollbar? Idk what a scroll rect is but i've worked with UI enough in the past months that i think i can help.
the scroll rect is like the area where the messages are kept
it starts at the top, but i want it to start at the bottom
ive fixed it
try setting the Canvas Render Mode to world space or screen space - camera
Thanks
is there a way to make the text go along the slant?
i tried doing it manually but
it doesnt looks very good
colliders and raycasting isn't required for world space ui
what is the map? UI?
oh, sorry.. the 3d environment
how come the inventory is using world space UI?
Select the canvas -> change the layer to UI -> say yes to change child layers too
This won't fix the issue on its own, but should be something you do anyway
can or cant?
🙂
The inventory looks like it could be screenspace, and keep the dialogue/ popup UI as worldspace
.. assuming there's no interaction on them
screen space camera or overlay
that doesn't make sense to my question 🤔
screen space overlay can't be blocked by the world
so on the screenspace camera setting - what plane distance do you have set?
Hi. I was wondering if anyone knows how to make an element in a scroll rect become a header. I'm trying to achieve something like this: https://youtu.be/jXCrM1rzLZY?si=nnvxm5tIKOG-3_xF&t=71
Thanks in advance.
Retweet: http://clicktotweet.com/lUIci
Name: iOS 6: App Store
Description: An in-depth overview of the new features contained within the iOS 6 version of the App Store.
~Gear I use~
Camera I use: https://amzn.to/2GyStT0
New favorite lens for it: https://amzn.to/2JjJJ4P
Other great lens: https://amzn.to/2JeKHPI
^But you need this adapter: https...
I can't understand this.. too many typos and poorly written question
and what is the map there? the scroll that is selected?
this is just the start menu
you can see the mountain in the start menu want it to be less transparent
I cannot see the mountain through the scroll. Only where nothing is covering it
oh guess im triping then 
your scroll has some pattern on it - disable the mountains gameobject and it'll still be there
or just move the scroll around, the pattern wont change
yeah i see my bad
Hey All, Can anybody tell me how can i create this game?
"how do i make this entire game" is way too broad a question. Also what does it have to do with UI?
why does my canvas, that is an overlay canvas with just a constant pixel size canvas scaler, with 0 scene changes between 2 projects, display buttons in completely different spots between the 2 projects?
it's the same resolution, same screen, same anchoring, same everything. But in one project, buttons render properly in a corner, the other it's at the bottom of the screen
it's the same resolution, same screen, same anchoring, same everything.
I would venture that you are mistaken about something here.
possibly different canvas scaler settings for example
maybe--I even created a new scene, dropped in the prefab instance, changed NOTHING, and it still is different
what's in the prefab?
I'm losing my mind. I'm going to make a text asset in the scene to display all of the info on the parent transform
why not just look at the inspector(s)?
it only displays this behavior on a build
in the editor it behaves correctly
inside the prefab lives a canvas (overlay), a root rect transform under that has a button under the rect transform. the rect transform has a horizontal layout group object that has the same settings between each project
For what platform? Could you recreate it by setting the resolution in game view?
windows--I set the game view resolution to be the same as the target build resolution
I've played around with nuking the horizontal layout group and it just never works right
I've tried setting the anchored position of the rect transform at runtime too and in the problem scene it seems to think the highest y value is 400 (which is like a 3rd of the screen size vertical)
Are the two projects on the same Unity version?
Yes
Hm I'm going to try recreating it from scratch--there may be a prefab specific change that is messing up the anchoring
Yeah no, recreating it to be exactly the same--in one project the button appears in the top left, the other project it appears in the bottom left corner. Both are anchored to the bottom left corner
Any difference on the anchor settings of the parent?
IIRC the direction of the group layout depends on where the parent is anchored... or something
I always have to re-figure this stuff out
no differences bettween the projects
I mean, presumably something is different. It's not like Unity is doing a hash on the project name or something... right?
well yes the projects are different. I could create 2 additional projects and drop this in. There's no scripts making any changes to these ui items either
In this case, I need to anchor to the bottom left corner and move the layout group containing the button up to kinda be in the upper left corner--the anchoring on the bottom left is important so it always has the same height
I think in this specific case it's a Unity bug
does the shadow component just not work with textmeshprougui?
Hello everyone, beginner here wondering if you can help me, my issue is simple. Color of font is different from the one I chose. Already tried to change the materials, but all the others look even worse (blurry, change colors, etc.)
Hi! I am wondering if there is a way to remove the extra spacing on the bottom of the "Dropdown List" that is created. Thanks in advance
it's changing the Y value in one project from being set at 1100 to 0. When I set the position using
GetComponent<RectTransform>().position = new Vector3(xPos, yPos, 0);
(also tried using anchoredPosition w/ vec2)
it sets the yPosition value like 4x the value put in.
aha, I see why. I was setting the position via registry key and it was reading default hexadecimal. Using decimal and setting position works normally. Now to figure out WHY unity is resetting the y position at all
Make sure that Lighting isn't just taking up a lot of space. Select its object and see if its rectangle reaches all the way to the bottom of the dropdown
(you'll need to unfold Content)
Thank you. Now I've checked that it doesn't
How do I proceed from here?
Looks like I have something similar going on in my game. I have a little gap at the bottom of a dropdown
Interesting. I don't suppose that there is an easy fix?
had to snoop around in the code, but it looks like it measures the difference in height in that template between the "Content" and "Item" objects
If you reduce the height of the "Content" object to 20 (which is what I have for Item's height), the margin goes away
(i increased the height of Item to 28 here, but, same outcome)
There are no layout groups on these objects, so I knew it had to be somewhere in the dropdown code
All of Unity UI is implemented in a package, so you can actually look at how it works!
(not that it's easy to grok...)
You're an angel 🙏 Thank you very much
no prob! now I know how that works, too :p
Hello, I'm trying to make a slider ring with smoothed edges like in this video
Breathing exercises for kids are a way to learn important coping skills and build resilience. Practice mindfulness in a calming video exercise for children. | Subscribe and check out more great videos ➡ https://www.youtube.com/c/SagoMini | Giggles that help kids grow: https://sagomini.com/world/
Post a p...
Someone else recommended me to use 2 circles on each sliders end, is there any way i could achieve this or is this the way. if so how?
That's what i currently have
There isn't a built in way, there are assets on the store that do procedural UI like this - check them to see if they do what you require
https://assetstore.unity.com/packages/tools/gui/procedural-health-and-progress-bars-237711 I only found this one which is out of budget for me
then I guess you'll have to do it the way you've already been suggested
Hey, guys. I have some buttons on my canvas and a RawImage above it all that just darkens the screen in transitions. Is there a way to make this RawImage untouchable? If it's above the buttons it won't let me press on them, and if it's under them it looks bad.
Problem solved, I found the Raycast Target variable
Filtering probably
Any way to fix it?
why doesnt the caret show up in my text input?
It’s usually because there isn’t enough padding in the font asset. Remake the .sdf with a larger padding.
Weird things can also happen if you use a font size of < 1
why is my 2d game looking all weird like this, is my text too small in text mesh pro?
Hi when importing images to Sprites they always get a 2 pixel border added and a new Image is sliced not simple. I don't need any 9 slicing for most sprites and it goes bad with atlasing anyway so can I change these defaults?
Show the issue.
Show the import settings.
Show the inspector for the text.
I have Import settings I can apply optionally but they can not sepcify border on import
You can set default presets in Presets manager as well https://docs.unity3d.com/Manual/Presets.html
Ah yes I think it does take the border settings from an existing asset - it is just that those settings are invisible as you can not manually edit them in the preset inspector!
OK sorted thanks - their UI is missing all the details saved
editing via notepad I cansee the sprite border is saved
you've left off loads of the inspector.
Hey guys, i have a window with image, horizonalLayout and contentSizeFitter components, with a child text mesh pro that has a contentSizeFitter too. The problem is that when i set contentSizeFitter on parent to preferred, it uses the size of the image component from the same object. How do i make content size fitter ignore the image component?
If the parent's horizontal layout group is already controlling the size of its children, then you must remove the content size fitter from the child object
Show your whole hierarchy
As for ignoring the image, I believe you'd just need to add a LayoutElement to the offending object (and then set the minimum and preferred sizes to whatever you want)
yes, i found out that if you put the type of the image to sliced it ignores it
That's because that changes how the Image component computes its minimum and preferred sizes
but you say it's not necessary?
(the content size fitter on tmp)
because if i remove the content size fitter on TMP it stops working
You can view the layout properties of an object in the inspector (you might have to expand the window; it can be collapsed down)
Do you see a warning on the ContentSizeFitter you've attached to the text object?
yes, i do wanna avoid this, but i'm not sure if i can without coding my own layout system
i want to make it so when text dynamically becomes bigger, the parent becomes bigger too
this is the parent's configuration
Turn off "Child Force Expand". Turn on "Control Child Size"
The default layout settings suck. I don't know why they're set up like that.
I guess they "just work" in very basic situations
ohhhh oh my god, thanks
This may cause your UI to implode down to 0 width / 0 height
In that case, that means your child objects aren't asking for any space. They either need layout groups (so they can ask for space for their OWN children) or LayoutElements (to ask for space on their own)
I really need to write a tutorial on this. I've explained it to quite a few people, haha
It's not very obvious from reading the documentation
this would be pretty cool
basically, you use a ContentSizeFitter only when your size shouldn't be controlled by your parent
a fitter lets you control your own size
layout system is really confusing, especially when you need multiple dynamic elements nested in another layout element
You use them in scroll views, for example, to make the Content object as large as it needs to be
What if, for example, you have a scroll rect and you have the content child that has content size fitter and layout element. After that you need to have a button as a child that also needs to change its content based on its children, what do you do?
in previous project i just put content size fitters on all children and manually updated the UI within code, which is a horrible way
Where is this button attached? I don't understand the layout you're describing.
here's an example of a scroll view from my game
sorry, let me make it real quick for an example
Content has a ContentSizeFitter and a VerticalLayoutGroup
all of the children are single text elements (with a non-auto-layout-controlled child)
@supple basalt nevermind, turns out turning on "control child size" works for nested layout groups too! In the past i did it in a very silly way, putting content size fitter on every element instead
Oh yeah -- you'll want that all the way down
You may also want "use scale" -- if it's on, scaling up a child will make it use more space
if it's off, it'll take up the same amount of space at all times
Both can be useful -- you might want to make part of the UI shrink away without giving up it space
but you also might want to adjust the size of buttons in a list by just scaling them up and down directly
oooo i didn't know that, thank you so much! Ugh, if i had known this sooner i would've saved myself so much trouble in previous projects
this advice is absolutely lifesaving

hah, you're welcome (:
can you elaborate, what did I leave off?
Obviously the stuff above? You’re scrolled down..
sorry about that
You're using the 3d version of TMP (mesh renderer), not the UI TMP... is this intentional?
If i use UI TMP the text doesnt display:
well, because you've done something wrong
I do wonder why you keep cropping stuff out instead of sending the whole screen, and being scrolled up in the inspector
is it on a canvas?
my apologies it was not, thank you so much
everything is supposed to instantiate at the top but for some reason its at the bottom only the first at the top
fixed it a bit but i now can scroll beneath the buttons
Hey guys, I have a bit of an issue and I was wondering if anyone could help. Keep in mind UI is not my strongest suit haha
So I'm developping a mobile game and I'm trying to fit UI to different resolutions.
Because I want the buttons in my game to keep their Aspect Ratio, I get an issue when trying to line-up certain text on the button/image (not centered). Visual representation in the image.
Anyone know how I can keep the text relative not to the Rect, but to the Sprite/Texture inside the Image component, taking into consideration any uniform scalings that might've happened to it?
The simulator on the right is the good scenario
Edit: Should also mention that I'm using a tool called BetterUI to anchor elements in accordance to "Perfect Scenario"
The background should be the parent.
The stars/ middle text/ alpha'd box children of the parent, and anchored appropriately.
The text in the alpha box, should be a child of that box and anchored to the center of it.
Atm, looks like the text is anchored to the side of the screen and not the button
Yes, I should definetly separate them like that, but does that change the fact that the anchor "cares" about the Rect and not the "View" size of the button, and will try to place it percentually in the correct spot?
Like for example, let's say the text and alpha'd box should always be 25% to the left of the end of the button (visible button I mean), but in different resest the button's Rect is for example:
and due to that difference of the Rect, 25% to the left of the end is still outside the visual
Press T and use the UI gizmo tools
That looks like you've edited the margins of the TMP element and the rect transform for the text is the size of the button ... this is wrong
I have this circular progress bars filled with circles, Each circle has a mask
Which works if i only have the first circle enabled but after adding next ones, circles also show up on the second bars mask
how can i make the mask only affect the childs of that object and don't interact with other sprites
these shouldn't be shown on my 2.nd circles mask area
There seems to be a bug with TMP_InputField not disabling the caret as a raycast target when you make it non-Interactable. So it still blocks raycasts
Hi there
does anyone have any experience with using <sprite> tags within Text Mesh Pro?
Could use some help in the setup...
Got another question, how can I bring the Health TMP Text to the front? In the Circle there was a layer int I could change but I dont see anything for the Text.. Also I thought the hierarchy changed the order but it's not changing anything?
UI is drawn in hierarchy order, from top (first) to bottom (last).. so if that Health object has text entered.. it should be on top. Assuming the font isn't too large and being hidden/ truncated
You should have just shared a screenshot of the entire screen, instead of cropping off the inspector - it could include details that would show the reason.. now gotta wait for ages ¯_(ツ)_/¯
probably because of your anchor points being improperly set up
well how should they be set up
and which anchor points
well do you want them to be offset from the top, the middle, or the bottom
what objects are misbehaving?
i want it to look like this with the ability to scroll down
i am able to scroll past even when there is two buttons like in the pictures
you click on this. And then when its parent is resized the distance from the anchor point is kept the same
are you using a scroll preset?
I think it's called a scrollview maybe
no
the content rect just needs to resize to it's child.
That's it. If you have the rect larger, the children will spread out
my settings
How are you scrolling then?
how do i do that
oh i thought u meant i got a scroll view by right clicking and creating
that is what I meant
If you have a vertical layoutgroup... then it's one of the tick boxes, you'll have to faff I can't remember which is which
resize to child size or something
use child scale?
try it and see..
oh also that just makes this happen
What just makes that happen?
changing the padding
the rightmost one is padding 100 and the left is padding 10
my sampling point size is 100
currently the font size is 4.75
what scale is the rect transform?
Huh, I didn't know that
use the height/ width to change the size of things
I don't think going larger here is the issue (going smaller than 1 can cause TMP issues, not seen issues going larger)
what about with 9sliced things?
what about them?
with height/ width .. why would that change anything?
height/width just tiles it
does a different thing
scale makes the source image bigger
... no it doesn't
Changing the scale of a rect (especially when done in a non-uniform way) leads to very strange and unwanted scaling of children
Well either way setting it to 1 did not fix the issue
I didn't say it would, in fact I even said it's not the issue
share a video (of the entire editor, don't clip anything out) and show the inspector for the canvas and every game object that leads directly down to the text
When you created the sdf, did you change anything from the default settings? (expect the padding)
Mine looks like this, and as far as I remember, always does
yours is like this
No idea if that makes a difference, but it doesn't look right atm and is worth investigating
I just use default settings like this
I changed the sampling point
how I created it was by right clicking on a normal font file to make a tmp font file
I set the sampling point size to 100
my textmeshpro install appears to be broken - whenever i try to open the font asset creator, my entire unity editor crashes. anyone got any ideas? should i reinstall? might i have to make a new project?
Ideas:
- Reading the editor logs for a clue as to the crash
- reinstalling TMP
- Updating unity editor and all packages to the latest versions
okay, i'm on u6 23f1, i'm going to update to 30f1. i'll take a look at the logs too
Ok it's definitely the padding after some testing
I'm not allowed to set it to 0
But this is a pixelart game
how do I get the text to have sharp edges
yeah for some reason unity just doesn't have a lot of support for pixelart
it started out that the editor just wouldn't let me generate a font atlas thing using hinted raster
and now the font asset creator is bricked entirely
I guess I'll need to not use a preset font and watch a 15 minute tutorial
I do not like tutorials they take forever
cant tell if maybe i should ditch TMP and use the default unity text
or what
i still cant rly tell if tmp is like
the intended text tool for unity
or if its deprecated or being replaced or whatever
I'm pretty sure TMP came after the original text tool for unity, but it's an addon. It might be mostly designed for Vector-based text though
I'm going to try using the default text
please do let me know if you manage to get that working more smoothly
im at a loose end with this LMAO
well the top layer is the default text, the bottom one is the tmp
the tmp has been massively misbehaving but the default one is just gross
tmp was on 3.0.6 for some reason
after upgrading this looks a bit better with padding 9
This is pretty good
Any way to make the text make the object bigger when the text gets too long?
enable pixel perfect on the canvas?
(never used it, may not be relevant)
hmm it only seems to scale from the middle, but if It scales too big I think it will go out of bounds
I want it to extend downwards only
Doesn't really fix it it just makes the pixels snap better
oh pivot change works
for the extension
You need to adjust the anchors on the RectTransform, then
specifically, you want to put the anchors at the top-center
Changing the height of the RectTransform will now cause it to grow downwards
It was actually the pivot
oh, right, wrong word :p
it's easy to mix the two up
the anchors control how the RectTransform grows and positions itself relative to its parent
yeah
My bad, heres the inspector included
What's going on there then? 🤔
Scale should all be 1,1,1 .. but your width/ height values being set at 1 is tiny
I dont know if I'm doing the whole UI thing correctly 😂
I was told to set the canvas to World Space and resize it to the card which seems fine but everytime I create a new element, its absolutely massive
Have you looked at it in the game view? Based on the grid the entire card is 2 pixels wide
The size in the scene view doesn't mean anything
yea it seems to be the same size in both
why did you set it to world space?
If I take it off world space then the size is super big and cant be adjusted to fit the card
Im probably doing it wrong, im open to any tips or videos yall know of
card?
Are you trying to fit a gameobject?
I'd recommend building the entire card in ui
Then you can nest everything in one object
Much simpler to manage
I don't suppose there's any way to automatically organize objects like the Containers in godot?
Can you explain what these Godot containers do?
Then maybe we could answer
Based on what I see here: https://docs.godotengine.org/en/stable/tutorials/ui/gui_containers.html
Yes UGUI has similar features
Seems like Container in Godot more or less == RectTransform in Unity.
What exactly I'm trying to do is take a bunch of rect transforms, and arrange them vertically so that they don't overlap with one another, but I don't want to nest them all.
I could do this through script but I'm wondering if there's a better way
Don't want to nest them
You wouldn't nest them to each other. You would have a parent and they'd be children of that parent (making them siblings) and the parent would have a vertical layout group on it
VerticalLayoutGroup
Mentioned in the links i shared (AutoLayout)
Alright Thanks it tiles things properly after a bit of property management
Also, where in the docs do I see where a component is located in the Add Component Menu, if possible?
I don't think that's listed anywheere in the docs. YOu can always use the search bar at the top of the add component menu to quickly find things
UI stuff is typically under UI
strangely it isn't there
what are you looking for
The layout stuff is under Layout
the vertical layout component, and its related components
Oooh I didn't see that category
honestly I never use those categories - I just start typing the name
just type 'vertical'
I just wanted to see its related components
By the way there is also a newer UI system in Unity called UI Toolkit.
If you want to add to your confusion you can check that out too
lol
I thought about putting all of my components into categories
then I realized I literally never used them, ever
(that DOES get rid of the (Script) after your component's name, though)
This is inside a vertical layout group. Is this fine to ignore?
it also happens to be a vertical layout group of its own
yes ignore it
Hi there! I'm trying to make a ui element in my scene follow the position of the mouse, though it's currently not going anywhere near it, and when I move the mouse, the image moves at a faster rate creating a kind of disconnect between the two. I know I'm doing something wrong, but I'm not sure of a better way to do this. Here's an example of the issue and the code:
This means that your auto layout isn't set up correctly.
You should not have a content size fitter here. The parent's layout group should be controlling the size of this object's RectTransform.
A couple other things: 1. know the moving pos is not the set to the new position, that's intentional for now
Have a look at this conversation.
and 2. It has to be with localpos as I am using a world space canvas due to the way my camera and UI works
I don't think that vertical layout has any sort of support for making the object bigger when the text is bigger
Content Size Fitter is doing the exact same thing that the vertical layout groups are doing
...it's just that the default settings for a layout group don't make it control the child size
Get rid of the fitter, then configure your vertical layout groups so that they control child size in both directions. Turn off "Child Force Expand" too
This may cause your UI to collapse into a weird 0 pixel wide mess. That means that some of your objects aren't asking for any space
They either need a layout group (to make space for all of their children) or a layout element (to directly specify a size)
does anyone know how to reinstall textmeshpro? i don't seem to be able to even find it as a package
it seems to me it's been folded into the UI package, but that seems like it would be a nightmare to reinstall bc of so many dependencies
Ideally you use one 🥲 but you can totally get away with more
This is so annoying haha
it's simple enough once you understand how auto layout works
The problem is that none of the UI elements you can add through the GameObject menu are set up for auto layout
a Button will only ask for enough space to show the edges of its sliced texture (so, something like 10 pixels)
the text content gets obliterated
a Slider will just
disintegrate
So, regarding strings in Unity, the TMP seems to cut off the spaces at the end of strings.
if I write: /// , the two spaces at the end disappear.
I tried using normal spaces as well as the No-Break Space (U+00A0) character.
They're both snipped off.
Anyone know how to create empty space with TMP?
Does this happen even when you directly set the .text property on the component?
Hi there I'm still having this issue, if anyone can help please do, thanks!
you're mixing up world space positions and screen space positions.
mouse position comes in as the pixel location on the screen, not an in-game world position
I am aware of that, my bad for not mentioning, how can I kinda translate it so that it's screen space?
Hi guys, I have created my own customized dropdown button. What I want is, when I press the first dropdown button, it should not overlap with the next one. There should be an animation for the upcoming dropdown, making it move down smoothly. i have added this buttons in Scroll view
how cam i achive it
out of curiosity, what was wrong with the built in DropDown?
my slider is getting vertically squished by my verticallayout
Which slider? What's it supposed to look like?
This means that your slider is not asking for any space.
Yeah because I'm counteracting it by going outside the bounds
The settings on the layout group will matter, and if you want special stuff you should be using LayoutElements
so its parent says "ok, you get 0"
How do I make it ask for space?
LayoutElement
Yeah -- that lets you manually specify the min/preferred/flex width and height
Look at the bottom of the inspector. You should see a Layout Properties window (it might be collapsed). It shows you the values for the selected game object.
Oooh finally a way to do that
I was getting annoyed by vertical layout for so long without that
What object do you have selected here, exactly?
oops I clipped out the heirarchy