#š²āui-ux
1 messages Ā· Page 29 of 1
in this case, I would have the slider declare a minimum height that's large enough to show it correctly
if this is a parent of the slider you can/should use content size fitter
Not if this object has a layout group on its parent.
However, you could put a vertical layout group onto SliderObject and have it control child size
If you did that, it would ask for enough space to show Slider
Slider would then need to ask for enough space.
yeah that's what I'm doing
I have plenty of places in my UI where a layout group controls a single child
Oh I meant layout elemtent
Strangely my text is resizing but only up to a certain point
you may need to change the min and max size on the text component
You should never have a ContentSizeFitter displaying that warning message about having a layout group on its parent. That means your UI is set up wrongly.
It can cause some very annoying behaviors
I mean the object not the text itself
the text object
You'll have to show me
Do you want the text to get even smaller when this happens?
If so, you need to reduce the minimum size on the TextMeshProUGUI component.
No I just want the object to get taller
ah, okay
If it gets too small it will be unreadable
In that case, you need to use a ContentSizeFitter to make the entire window grow to fit its content
That's where you use a fitter -- when you have no parent layout group
but it does have a parent layout group
I'm talking about the entire popup window. Does that have a parent with a layout group?
Oh wait -- isn't this supposed to be a scroll view?
Yeah, I get it
Put a ContentSizeFitter on the "Content" object
It has one already
God only knows why this isn't there by default
okay, and is it configured to use the preferred size?
but sliderPropertyManager also has a vertical layout group
That's fine. Content will also need a vertical layout group, though.
yes
Otherwise, Content will have no idea how much space to take up
they both do
Show me the inspector for Content
You are not controlling the child's height
Oooh yeah thanks that fixed it
This means that Content cannot resize its children to be taller or shorter
I would default to controlling child size and using child scale in both directions
and not using Force Expand
Yeah -- it's going to ask for enough space to display at maximum size
I believe this is the order of operations
- The layout system asks how much space it wants
- TMP calculates space for its maximum possible size
- The layout system gives it some space
- TMP calculates a size based on that space and where it can break lines
I'm not sure how you'd make it reduce the size first, then start expanding the Content area
Maybe you want to use Min Size instead of Preferred Size on the content size fitter?
Interesting. Let me try that
The text is only showing because I set it to overflow, if I set it to truncate then it is invisible
Ah yeah -- it looks like the text component gives you a min height of 0
You could give the text object a LayoutElement to set a min size, which looks pretty good, but then it won't start growing once the text component hits its minimum font size
since the content size fitter is looking at the min size, not the preferred size
I'm trying to use Textcraft Styles, such as this. I can extract hex color from the image, but the hex color changes in each pixel. I currently have the font in a .TTF file, but i have no clue on how to extract the style or get it from Textcraft. Anyone know a way to get the style from the image, or recreate the style. (second picture is from my game with the font asset)
How can I get this look while being able to change the text at runtime?
The problem are the big quatation marks. I've been playing around with TMP tags but this is the best I could get:
<size=115><line-height=51%><voffset=-0.3em><color=#C08676>ā</color></voffset></line-height></size>Despite my previous experience characterizing and injecting botulinum toxin type A in monkeys, it was still an emotional experience to inject that first human patient. I didnāt know if Iād be able to keep my hand steady for the injections. <size=115><voffset=-60><color=#C08676>ā</color></voffset></size>
and it looks like this:
yo Vice, you could just make the quotes a image with % size of container
and add padding to the text
That won't work for the closing quatation. That can be anywhere in the contrainer
if the last line ends with one word, the closing quotation mark needs to be all the way on the left side, next to that word
you could name a container, and make 10 lines of text, with each line only taking "_" characters, if the word cant fit in that line, move it to the next. on the last line of text, instead make it a container like this, and make the label flex grow = 0, and set specific width % on the quote image. Looks like this:
or just make 2 containers for the text in that big container, with the 2nd one being for only the last line of text
I got a question, maybe someone can help me cause I struggled to learn this thing. How does UI work and how to make an UI thats immune to any resolution. Like If I put something in the middle, I want it to remain there no matter what. Like Custom things cause If I wanted on the center or the edges I would anchor it.
Anchor it in a place and then move it with position does not help cause at different resolutions, it causes damage
is this a bug
in game and scene view i have only 2 buttons but on simulator too many buttons , im using LTS version tho
if anyone know please help
Could of warned us headphones users 
Most likely not a bug with Unity.
im using LTS version tho
LTS versions arent bug free.
how to do this exact button system in unity
That looks like a Dropdown
Or maybe a Tree view
it is dropdown only but i am lagging to getting exact same
why isn't it letting me interact?
maybe GridCanvas is blocking it?
Click on the event system while the game is running
and see what it thinks your mouse is over
I can press other buttons and gridcanvas is set to none
how do I see that
I think that only shows what's selected, which I can select the slider
I've got a UI issue.
The red bar is a select-thingy, and it can fill the space of any element inside this menu here.
In start, I want it to fill the first element, when I do so though, it doesn't align correctly.
This is done in Start, so I'm assuming there's something that UI does during start (either recalculating anchors or positions whatever) that disrupts the code.
The code is quite simple. All it does is align itself with any RectTransform without being a child:
private void FillRect(RectTransform t)
{
int stealIndex = t.GetSiblingIndex();
if (t.parent == transform.parent && stealIndex > transform.GetSiblingIndex())
{
stealIndex -= 1;
}
rect.SetParent(t.parent);
// Place just above the transform we're interacting with
rect.SetSiblingIndex(stealIndex);
rect.anchoredPosition.Set(t.anchoredPosition.x, t.anchoredPosition.y);
rect.pivot = t.pivot;
rect.SetPositionAndRotation(t.position, t.rotation);
}
I run this code in Start, and it ends up looking like image number two.
The X and Y coordinates are off, as well as the anchors.
Any ideas?
I am using a Vertical Layout Group for the element it should fill, so it might have something to do with that.
#š»āunity-talk message @wispy dew -- to elaborate on this, your canvas is in "Screen Space - Overlay" mode.
This draws the text directly onto your screen. The apparent position and size of the text in the Scene View doesn't matter.
Basically, if you put something at X=100, Y=100 on an Overlay canvas, it appears 100 pixels from the bottom-left of the screen
Have a look at the Game View window
@supple basalt heres my project in free aspect
and yeah the boxes arent aligned anymore
hit F to focus on that button
that'll do it
hm, so you need to line up properly with parts of the sprite?
yup
You could consider using a world space canvas instead of an overlay one. That way you can just directly position everything, and it won't move at all as the screen resizes
ooo
You just have to make sure that the start and quit buttons are actually visible to the camera
Oh wait
that's not a sprite renderer; the background is an Image
I was mistaken
Okay, here's what you'll do
but just to confirm -- the Button_Start object doesn't display anything at all, right?
It's just an invisible box
just invisible yeah
okay, so we're going to adjust how it's anchored
Right now, it's set to not stretch at all, and to be positioned relative to the center of its parent
We're going to use a custom anchor setup here.
Do the visible buttons stretch and squish as you resize the window?
doesnt look like it
do you have Preserve Aspect checked on the background, then?
I was expecting it to be changing proportions
where do i find that?
This is the behavior I'm thinking of
as the canvas changes size and shape, the background image stretches to fill it
and the button correctly follows along
Is that how the background reacts as you resize the game view?
is there a way to move the entire view like that?
pop out the game view and resize the window
ah
I was demonstrating on a World canvas to make it easier to show the editor gizmos
but it's the same principle
the size looks like it stays the same, the position just changes
In this case, the background image has been set to fill the canvas. That might not be what you have
Can you show me the inspector for the background?
I mostly need to see the RectTransform
Okay, so the background image is set to fill all of the space its parent provides
it's stretching on both axes and left/top/right/botttom are all zero
yup
That should make it look a lot like this
i can try to screen record
Basded on what you've shown, here's what you should do
Go to your button object and set it to stretch on both axes
Set left/top/right/bottom all to zero
The rectangle should now fill the entire canvas
then, press T to activate the Rect tool. you should see this, with four blue dots and some white arrows at the corners
Drag those arrows to fit the button you see on the background image
Then set left/top/right/bottom to zero again (the editor will have adjusted them to compensate for this change, and we don't want that)
This will be the result
This makes the button take up a certain percentage of the screen, basically
It's not 300 pixels from the bottom. It starts 10% from the bottom and ends 20% from the bottom
This will make it exactly match how the background stretches
yeah, you'll do this for both
Note that it's probably easier to just separate the button sprites out from the background!
I should've mentioned that earlier...
It now says "Custom" because this is a bit of an unusual setup
You usually have either no stretch or 100% stretch
compare your background image's Anchors to the button's anchors
The first one means the background stretches from 0% to 100% on both axes
the second one means it stretches from...about 30% to 40% on both axes
You can read more about how RectTransforms work here https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/UIBasicLayout.html
thank you!!
no prob (:
I use this when I need something to take up a specific fraction of the screen size
this will be very handy 
Okay, I've found the reason for why it doesn't align.
When starting the scene, the anchor-values for things in a layout group seem to change for just a moment. This must be some kind of repaint from the UI to make sure everything is where it's supposed to be. The issue is, this doens't run well with my code. Anyone know why Unity does this?
there is technically a "solution" which is to just run the code in Update instead. The first frame is strange, but the rest should be fine.
I dislike this though, as I'd prefer not to have it running in Update. It's not needed.
Hey folks! š
Not sure if this is the right place to ask but here I go....
I work as a UI artist in a studio that uses a very old in-house engine.
I'm in my junior to mid stage of my UI journey and I don't have any experience with implementation, scripting and anything like that with any popular engines.
I would love to start learning Unity since it looks like it's more beginner friendly then Unreal, but I'm not sure where to start. I have zero experience with code and scripting.
I would like to learn how place the actual ui elements in a Unity canvas, simple transform animations, understanding Unity animator parameters, maybe some basic particles VFX, different Unity Ui component helpers, asset export, prefab workflow, etc... this list would be my end goal.
I know there's TON of tutorials out there and I'm overwhelmed with choice.
Is there a structured course that is made for UI designers/artist in mind I can follow?
Any info would be helpful!
What is the a good way to implement Diegetic UI into this 3D Model? Can I exchange Textures or should I put the UI 1mm on top of the Screen
If you just used textures, you'd have to create your own event system to interact with it.
UGUI has a world space canvas setting for things like this
Does anyone have any resources regarding writing a custom event system?
guys is there any way to insert a button into text mesh pro?
like, i need a way to insert it into text itself, it has to be dynamic
for example
oh thanks, i'll try to look into it
does this look good?
how do i handle this when dealing with higher screen resolutions than planned?
i did up my entire scene specifically aiming for 1080p
i'm perfectly cool with all the UI elements just... staying in the same place
instead of trying to stretch with the screen
and i can just make that green texture expand out a bit
i'll figure it out. suggestions would b helpful though
Hi, I was wondering what the proper way to have any image envelope the canvas is whilst keeping the aspect ratio?
I tried using envelope parent with a custom aspect ration, however, that doesn't work since not all the images will have the same aspect ratio.
What'd be the proper way to go about this, a custom component or sm?
I was able to achieve this effect by doing the following in the code:
var systemSprite = Misc.SpriteFromFile(image);
_systemImage.sprite = systemSprite;
var rect = systemSprite.rect;
_systemImageARF.aspectRatio = rect.width / rect.height;
_systemImage.gameObject.SetActive(true);
But this only works if you are loading the image via code, is it possible to achieve the same result in editor with an already existing component?
Hard to tell with how rough the text. Iād give the elements some more margin, with the buttons and tabs being too close to the tab on the left.
If you (reasonably) donāt want to spend money on Illustrator, try Inkscape for vector graphics. Itās a pretty cool Foss alternitive
Also, if text on the left column is green, be constant, and give the text on the right the same colour
Putting this here as I have no idea where I can talk about text. I don't know why I can't see my UI text or why I can't change my fonts.
I already have both, I used Inkscape to make buttons
I know the font isn't perfect, I'm still looking for one that would both more readable and fit the game's style
the text color is actually supposed to represent state of a setting (green means on, red means off) but I'm still not sure if that's a good solution (especially for colorblind people). I might add some additional information about the state
thanks for your help
Donāt use text colour for that. Use a on/off switch or a checkmark box. Alternatively, make a āenabled/disabledā flag next to the button. As for font, Iād advise you just using a simple font as stylize fonts are hard to use.
Yeah, now that I think about it the color text was a really stupid idea.
Do buttons have USS substyles for when they are being selected by a gamepad?
you'll want #š§°āui-toolkit
@pliant ether wdym old ui system
Youāre using uGUI, correct?
i'm using the default unity ui
So you are using, Uxml and uss, and not the component based one, correct?
i'm not sure what you mean, i'm using the default unity ui package, and it has components
Thank you. There are 3 UI systems. I assumed you were using toolkit. Anyway, did you put a canvas scaler on your canvas? What is likely happening is that it is messing up in the build due to a different resolution.
well it's not just messing up the sizes, it also doesn't even display some elements
and yes i did put a canvas scaler on the canvas
been searching for hours, i think it's a unity glitch
yeah as i thought
i set the canvas to world space
I was thinking that it that they just fled off screen. Regardless, if itās a unity bug I canāt go into the source code and fix it
built, now the game is stuck in the splashscreen
yeah
it is what it is
That makes sense.
hello, I have a problem. I made a child image on my button, top left anchored. Issue is when button goes to left, image goes to right side to the middle. At most right of the canvas it works properly what is the problem? I cant solve
show us the RectTransforms involveed and the gizmos and which thing is going in the wrong place, etc.
I fixed somehow
Does anyone know how I can import asian characters in a TMP font?
I've been trying every which way to add japanese localization but nothingworks.
I've added custom character lists, fonts that aparently support japanese and much much more but I am at the end of my rope here
Iām really new to unity and I want to program a simple start button that will change the scene when I click on it, but I heard that I should use āUnityEngine.SceneManagementā but Iām getting an error code that says that there is no namespace called āSceneManagementā under UnityEngine Iām so confused can someone help
I just want to get this finished and go to bed but Iāve been stuck for too long
Does your code look like the docs? https://docs.unity3d.com/6000.0/Documentation/ScriptReference/SceneManagement.SceneManager.LoadScene.html
If it helps this is what my code looks like
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneChanger : MonoBehaviour
{
public void ChangeScene()
{
SceneManager.LoadScene(āSceneTwoā);
}
I forgot to copy the last curly bracket oops
I donāt know if itās my code or not because my error is saying that I donāt have āSceneManagementā as a namespace under UnityEngine
Is that what IDE telling you?
@limpid iris Make sure you have !ide installed properly so it has Unity integration.
If your IDE is not autocompleting code
or underlining errors, please configure it.
Select one:
ā¢
Visual Studio (Installed via Unity Hub)
ā¢
Visual Studio (Installed manually)
ā¢
VS Code
ā¢
JetBrains Rider
⢠:question: Other/None
Iām using visual studio 2019 and itās not showing that I have a syntax error or anything like that
It might be because Iām using an outdated version of unity but I thought that it would still work the same
You should be running latest minor version at the very least and update to VS 2022, you can install it from the Hub all the integration will be installed properly for you.
Iām using unity 4 because thatās what my school has on their computers
š
And might as well change to unity 6
Iām gonna let it download and try again in the morning
IIRC SceneManagement didn't exist in Unity 4
Iām switching to unity 6 rq because why not
4 -> 6 is massive change, expect lots to break
back up with version control before starting
The only reason to use a font asset here is to copy its own set of characters
unity WHAT
that's catasatrophically outdated
Ik š¢
so should I remove that and just have the custom character list?
Yeah. I'm not sure how it'll behave like that
I'd expect it to union the two sets of characters, but who knows
ideally you specify the glyph ranges in hex and not provide a sample text
you can use this page for reference https://www.unicode.org/charts/
you can also set the asset to dynamic and glyphs will be added automatically to the asset when used. When done (project release), disable the dynamic toggle.
also if you use the NotoSansCN (chinese) version, you get absolutely everything in the source font, including japanese and all the western languages.
Hey does anyone have a good resource to change geometry in unity gui?
i want to create a 1 side rounded fill timer
something like this
So this is a little tricky due to the bend
You can make such graphics in photoshop or a vector format and import to Unity
You can't just use a horizontal fill
as for drawing the bar - I would use a shader
yeag
A custom shader would let you compute which pixels are filled and which pixels aren't for a more complex shape
yea but is there any resources to start on shader?
plenty
i have no knowledge on shaders
Modern Unity versions let you write UI shaders with the Shader Graph
yea I have tried using them but since i lack any basic understanding of shaders I was not able to achive my desired result
I just need some documentation about shader dealing with bended UI
Something that comes to mind is a "fill texture"
It would have a color gradient ranging from black to white, where the color tells you how far along the bar the pixel is
I'm not sure how you'd create that gradient, though
this is a great idea
It might have problems with longer bars, since you only have 256 colors to work with
I guess you could use 16-bit color
you could use all four color channels and treat the value like a 32 bit int
don't worry about what that looks like in the texture š¤£
or how to create such a thing
I did consider that, yeah
at that point you might as well just use a 16 or 32 bit color format
(with one channel)
Hey, I am making a mobile game with TextMeshPro and plan to add multiple languages (Latin, Cyrillic, Japanese, Simplified/Traditional Chinese and Korean) but I am not sure how to make the Font Assets properly and their Fallbacks.
I am using Fira Sans font which covers Latin + Cyrillic, Vietnamese, etc. I'm not sure whether to create a Font Asset using Unicode Range (hex) and include the characters of all the font languages I'm interested in and use it as main font, or otherwise create a font asset Extended ASCII as main font, and then create different font assets using Unicode Range (hex) for each different alphabet (used as Fallbacks).
About whether to create the text fonts in static or dynamic, my idea is to create them in static and then make a Dynamic of all the font characters that will be used only in input fields. For the other alphabets (Japanese, Korean and Chinese) I know I should use different fonts, but should they be static or dynamic?
Finally I would like to know which Render Mode to use (SDF, SDFAA, SMOOTH, etc) for the font Assets and if I can edit the atlases in photoshop to add custom shadows/outlines, or is that considered a bad practice?
will layout element guarantee ur UI width at least having the width of minimum width?
because mine isnt
i expect if i fill in 200 in min width, it will be 200 if its not heavily restricted by other components
SDFAA with 10% of size for padding, you best define the hex ranges for the alphabets and potentially custom selections for ideographs (kanji)
a complete font asset including all ideographs from Chinese requires a 4k by 8k texture at a usable font size. You can use dynamic mode to figure out which characters you need. But itās unreliable.
If you want to use a second font for your ideographs, you can make an asset just for those and define it as a fallback in the main font. You can also split assets into multiple smaller textures. I donāt think that saves any memory though but may work around texture size limitations.
Usually you can put all your western alphabets into one asset/texture
why is creating a dropdown look so malformed like this? i have the item selected and its really badly formed
okay for some reason all the scales are 1.9893
and the positions are off
wtf
Do you think it is better to merge the Latin + Cyrillic alphabet into one font asset (since the original font covers both), or is it more optimized to create 2 different font assets?
Put them all into one unless you have a good reason not to.
I tried to do it but it gives me a font with 996 characters that in text looks deformed. Do you know why? I used a size of 2048x2048 and padding of 10
Maybe a screenshot of settings and the effect would help understand the issue
it was a mistake for using the wrong Unicode codes. Now it looks good
Is SDFAA a good render mode or not the best for mobile games? I also wonder if I can use SMOOTH to edit the atlas in photoshop and add custom outline and underlay (I think the text customization in PS is better than in Unity).
These modes only decide how the asset is created, the rendering of the glyph shape and all effects happens at runtime based on the generated texture in the asset, it makes no sense to modify this asset texture. SDFAA is the recommended mode. It works well in most cases and also with dynamic assets. SDF16 and 32 are more accurate but take longer to generate, useful only for very large text.
I was curious guys would you use Ui toolkit at this current stage?
or you would use more standard gui system
I would mean in a runtime context
If you are vibing with webdev patterns and MVVM, you would pick toolkit, if not, if you want to apply unity component architecture to ui and avoid a system that relies heavily on specialized tools, use ugui
valid. I liked the resizing of ui toolkit. Although im not super familiar with the CSS aspect of it haha
Thinking of toolkit as html+css certainly helps to get going with it. But itās a lot of work to get anything look nice & non-default. Whether it solves any of your problems better than other options is an open question you will probably never get an answer for.
It will certainly be the recommended way. whether that turns out to be smart, weāll never really know. Its main issue is the same as with most MVVM frameworks: they are complex generic solutions to millions of specific problems and force the user to dealing with that complexity without really giving them much (affordable) opportunity to mold the system to their actual needs.
Itās always the same with these things they are great at solving easy problems but donāt actually solve any difficult ones
well css is great at what it does
in general
just unity dont implement half of it
like css-grid is a two flag
Itās powerful in theory but does make it very hard to create good ui for the average user/designer
Because it offers zero guidance and few constraints
Itās not supposed to be a webpage renderer. If they implement everything that also makes rendering more complex
Just look at the millennia of development time that have been put into the chromium renderer
Do you mean to make a regular inventory panel with icons. Thatās not supposed to happen š¤Ŗ
itās also very OOP in a composition world
and itās always fun to docRoot.Q(āmy buttonā) as Button nothing wrong with that šµāš«
Heya, I'm trying to use a scrollview to horizontally display these items. They are loaded dynamically but for some reason on top of each other.I have a content horizotnal layout group and content fitter. Im very confused as to why they dont space out
What's the setup?
What position do you spawn them at?
Do you have a layout group?
i fixed them spawning on the bottom left, they spawn in the center now but overlaid still.
Content has a Horizontal Layout Group with spacing 10 and a Content Fitter with both horizontal and vertical set to preferred size
the items do spawn correctly as children of Content gameobject
I forget which eactly, tick the width for one of these
that didnt change anything
the parent of the thing that is spawned - ClothingB... what's on that?
show the inspector
this is a prefab box im trying to use to display the items in
that's why it's not working
There's no rect transform, and the size of that is .. I dunno what it would be for the UI, 0?
The conent isn't expanding because the children aren't big enough to make it expand
so I should put a rect transform on the prefab?
let me see
Pretty much all UI elements should have a recttransform
I see. That seems to have worked. Awesome, tyvm
Well, here's the next issue. I wanted to have this placeholder guy show up to apply the clothing items to, and in the prefab he seems fine, but in the scene when i add the prefab he's just invisible? I gave this prefab a rect trasnsform too. I thought it was a later issue but even when i drag him out of the ui he is invisible
pls don't crop screenshots, you cut off lots of information
The sprite img is full rect
it's a sprite renderer, that's not for UI, that's for the game (world space)
What should I use then? Sorry ive done more code logic than ui logic
the same as everywhere else for UI - Image component
Just FYI - if you drag a sprite from the project window into the scene, it creates a sprite renderer game object. When creating UI, you can't do drag/drop - you must right mouse click -> ui -> image and assign the sprite to that
should i add an image component to the root gameobject or should I add a second gameobject
add it wherever you want - wherever it makes sense for your thing
i added it as a component and its entirely invisble 
Just remember, UI is drawn in hierarchy order.. from top (first) to bottom (last)
yes
yes, because the width/ height is tiny
so ill up the rect transform
it's currently 2px by 6px
i upped the rect transform to 200x200 and its still invisibke
it's not on a canvas in that prefab
I see, so when it gets added to a canvas in the scene it should draw
I would expect so
save -> close and reopen that prefab, it may add the temp canvas so you can see it
yes it did, oh god i feel so silly
and when working with UI, press T to use the UI gizmos
thank you again š
Hi, I'm trying to get this dropdown to expand further than this so the text stops overlapping?
the default dropdown should already be able to do this -- have you been making changes to it?
How can I add support using the new input system to navigate left and right using gamepad bumpers?
@proud sandal ok yeh once u get used to the workflow it is actually pretty nice to work with ui toolkit. even created myself an base class that reduce my boilerplate
I do not understand these glyph ranges and hex.
Do you perhaps have a link to a proper guide or helping resources.
Through my own searches, it's very hard to find actual help and resources
Plus, I have no idea what to do with this information. Do I just copy all of this and throw it into the text box?
I have tried using multiple NotoSans Fonts. CJK, CN, JP, KC, all of them, but when you generate a SDF file for TMP, it loses a lot of the characters and data
Unless there is some way to use the source font, instead of SDF, but I do not know how, other than to scrap TMP and use the built in stuff
Is there a way to not use the string lookup to find a control or to at least automatically validate or sync changes in the xml to the c# controller without building the entire layout in code?
You put for example, 0-FF into the text box in the asset creator, to get all ASCIi characters
What asset creator are you refering to?
And ofc you will loose glyphs, you only want to include the ones you use.
TMP font asset creator
I see
Thank you
I will try again with the fonts, and try to implement the HEX codes. Thank you for the help
If you set the asset to ādynamicā you will also see how that box gets populated with hex values for used glyphs when you use it as reference in another creator panel
Hmm I'm not sure what u mean but no it is not yet implemented for the string lookup
Then I really wonder why people are so hyped about it. This will constantly break ui code and end up being annoying to fix. Is there seriously no form of statically validated databinding or code-gen for runtime?
If i'm navigating with a controller, and then click nothing with a mouse, the selected becomes null. How can i recover that selected again?
EventSystem.current.SetSelectedGameObject
https://docs.unity3d.com/2018.3/Documentation/ScriptReference/EventSystems.EventSystem.SetSelectedGameObject.html
does this call the OnSelectHandler?
I should imagine so
I thought it wasn't because the wrong things were being selected, but I found out that was because I had the wrong things enabled first at runtime lol
It doesnt appear to, on second thought.
LocalButton is meant to fire a console log when its been selected
public void Select()
{
EventSystem.current.SetSelectedGameObject(null);
foreach (var button in GetComponentsInChildren<ButtonUI>())
{
button.ResetData();
}
EventSystem.current.SetSelectedGameObject(selectable.gameObject);
Debug.Log("Selected first item: " + EventSystem.current.currentSelectedGameObject, EventSystem.current.currentSelectedGameObject);
}
looks like it's logging?
Thats an object that selects a specificed object. this is meant to be called, but it isnt here
but it is selected when i start the scene
so that is weird
and when I navigate, it works so i am confused. but there is no visual response
are cursors always 32x32px?
confused about hotspots. cause if anything changes cursor size (OS or so), then doesnt the hotspot get offset?
Hi!
I just updated the editor from 2022.3 to 6000.0 and I'm facing this issue. The development console is now showing like this. Is there a place where I can assign the font/assets used to render the console text? Or what should I do to fix this?
(I'm not really sure if this is the right place to ask about this, but I don't see a better channel, so let me know if I should post this somewhere else.)
TMP materials need updating, should just need to re-import the essentials
oh wait.. half read your message... development console, is that Unity's or a custom one?
Yeah it's the Unity's console. All my UI is actually working fine, is just this console that's not working. But I'm currently debugging the log console rendering like this is making it a little harder haha
Ignore me then.. I haven't used that in years.
It wouldn't surprise me if it's just broken in U6 and not intended to be fixed as an out of date/ unused thing with a half-arsed/ no replacement
Hey all, i need help getting some ideas about implementing a attack range indicator for my character. Basically the range indicator is represented by the beige color bar underneath the character, I want the range indicator to extend or shorten during game play. One Idea i have is to use a progress bar represent the range indicator, however Im not so sure if the end of the range indicator will be kept or will it be chopped off.
Sounds like you want a 9-sliced sprite
or, in your case, more like a 3-sliced sprite! there will be no top or bottom pixels
A 9-sliced sprite keeps its corners sized normally, stretches its edges on one axis, and stretches its center on both axes
i see! im looking into it now, any ideas of some good tutorials for this?
Anyone use OneJS with UIToolkit? Is it worth using or does it overcomplicate the UI? I'm a software engineer by day, so OneJS looked interesting to me
ah so in my case when, you said ill just need to use 3-sliced, you mean something like this?
You'd just give the top and bottom parts 0 pixels
So it will wind up looking a lot like that, yeah
thanks! im going to try it now. Glad i didnt try to fiddle around with the progress bar first lol
Hi, does anybody know how to make the TextMesh Pro text not blurry? I have been trying for an hour and cant get it to look sharp
You'll have to show us how you're using it
hahah I hope it's just something temporary
I had issues with this console on my Steam Deck
But it was a different problem -- all of the text was completely missing
no error shader in sight
I had to explicitly set GUI.skin.font, I think
is there something specific I need to do to enable controller navigation in UI? I'm using the new Input System with Action Maps for Player and UI and a random controller I connected works flawlessly within gameplay but does nothing in a menu
ah, seems to me the Event System just needed the correct reference to an Actions Asset!
Hi I am trying to use the TextMeshPro function isTextOverflowing but it keeps on giving me false when my text is obviously overflowing. Does anybody know why?
well while Gamepad navigation works now, the arrow keys and wasd are being ignored even though as far as I can tell my Action Maps include keyboard for UI
hello, why I cant use my Icon in an image?
Change the sprite mode from Multiple to Single
My text is not showing for some reason ...
You don't have font asset assigned
See inspector under text input
THANK YOU SO MUCH
One message removed from a suspended account.
One message removed from a suspended account.
Hi, I'll give a look at that, it's probably a related issue. Thanks!
it worked thanks
I want to divide a canvas into two pieces. I tried using a horizontal layout group, but I can't figure out how to get the two pieces to be different sizes. How can I split the screen into two sections with a vertical division between them?
Basically, I want one panel to occupy about 15% of the horizontal width of the screen, and I want the other panel to occupy the other 85% of the screen.
I think I figured it out by adding a layout element to the green panel and increasing its min width
That seems to work
Is there a way to unpress (or should I say release?) UI button after you click on it? It stays pressed until you click it the second time, and I want to change it
Clicking sends click event once then releases the button. Make sure you don't have highlighted Color not set to something other then white, it would tint button on mouse over.
You may also be seeing the "selected" tint
There's an annoying conflict there. If you're navigating a UI exclusively with the mouse, then selection is pointless. But if you're using a keyboard or a controller to navigate, selection is necessary
Okay, thanks to both of you, I've fixed the issue!
hey, how do you set a max char limit to an input field?
There is a "character limit" field in the inspector
i dont find it
which object?
In the inspector of the TextMeshPro Input Field component
so im trying to put a 2d png with a transparent backround on a quad but everytime i select it as transparent it ends up looking like this does anyone know a work around? i tried it with roughly 4-5 differant images and they all end up looking the same
this is what it is so post to look like just without the white
it looks like the alpha of the texture is being ignored
This pattern is caused by "dilating" the edge pixels out into the transparent area, so that you don't get weird colors when sampling near the edge at a lower mipmap
it expands the color into the transparent areas
You shouldn't be able to see that color, though
yea i figured it out i just needed to change the rendering mode on my material to cut out for some reason
Cutout means that any pixel below an alpha threshold gets thrown out entirely
what shader are you using here?
Transparent
no, what shader are you using? the thing you pick in the dropdown
does any one here have a solution to the hidpi issue with linux and the editor? its not really usable in unitys current state on linux. i cant read the UI its far too small.
Hey, i wanna do a pie chart in UI, but i want to have some equitables parts. I just want to make the outlines of the parts, i let u some images for example. I want to have a parameter to change amount of parts
oh hey, I did this
Each wedge in this radial menu is an Image. I use a shader to compute the area that should be filled in
There are no sprites at all
But this system could not work with a radial 360 pie chart
i mean, u "deform" ur sprite with ur shader ? if u have no sprite
There is no sprite. The shader just figures out which parts should be opaque and which parts shouldn't be
oh okay, i see, and how did u do that shader ?
here, you can have a look at the shader graph
oh big thanks i'm gonna check ty
The gist is that it figures out the angle and radius of the pixel
Then it decides if that's "in bounds" for that wedge
Note that this means I have one graphic for each wedge
I might rewrite it so that I only need one graphic
(that'd just make it harder to put images and text on each wedge)
If you just need to show a disc with a bunch of segments in it, I'd go with a single graphic
It would be a similar idea, though
The shader figures out an angle and a radius
It uses that to decide whether to be filled in, empty, black (for the lines), or transparent (outside of the circle)
this shader is way too much complicated as i'm beginner lmao
i don't really know how to try on scene view ur shader
because i'm on URP
And how to do this anyway ?
maybe start out with a UI shader that just shows you an angle
The shader graph has a node to turn a position into an angle and a radius
"Polar Coordinates"
Also, what version of Unity are you using? I should make sure you can actually do UI shader graphs first...
I'm on unity 6
okay, that should be good
6000.0.30f1 to be exact
I don't really know how to create a UI shader
Oh, is it "sprite unlit shader graph" ?
ah, you want "Canvas Shader Graph"
unless it's actually a Sprite Renderer, that'd be the wrong kind of graph
Image components also use sprites
but they're rendered very differently
it's a image component on canvas yeah
so it's not canvas i guess
I don't really know how to just show an angle lmao
I know how to create some shader, but not in UI
I just saw that canvas SG can be used for image rendering
The process is pretty similar, then
Plug UV0 into the Polar Coordinates node and you'll get an angle + radius
You'll want to subtract 0.5 to center the circle
UV0 from screen position node ?
or UV?
Like this, i subtracted 0.5 to get center, but i guess it's not ok?
oh with center of 0 and 0 i have something
Yeah, that's the idea
I forgot that you can just set the center
The output contains the angle and radius (or was it the radius and angle?)
Try using other math nodes to manipulate these values
e.g. multiply the angle by 10 and then output white if that value modulo 1 is less than 0.2
Multiply by a large number and then take it modulo 1
the angle ?
or the radius
But modulo 1 is always 0 btw
or maybe i forgot some math techniques from school
The angle.
Only if you're doing integer math
oh ok
But it's always integer wherever i'm using even with nodes
i'm really not intelligent tonight lmao
i'm still completely lost lmao, i don't really know what to do with both of angle or radius
If you want to make a repeating pattern, you need to do something based on the angle
that's I suggested doing this
just plug it together and see what you get
wait, u want to plug the angle on a node modulo, and set B input at 1?
oh lmao i didn't get this
oh my god
perhaps a smaller number!
you may wind to divide by pi, too
you can just type in, say
20 / pi
and it'll compute the right number
on the multiply by angle?
Right.
If the angle ranges from -pi to pi, then dividing by pi will remap it so that it ranges from -1 to 1
oh i got some circular things
that's crazy
But with this now, it does just some visual illusion
lmao
Should I use now the radius to represent the pie ?
I was wondering why you got that crazy moire pattern
oh so it's not the good thing? lmao
wait
oh yeah
so i have a beginning of parts i guess
oh right, and this isn't actually "modulo"
it's the remainder operator
notice how the pattern stops when the input goes negative
grumble grumble
...mh i don't see the operator that i could put instead
You can add pi to the angle before you multiply it
Otherwise you'd have to do your own modulo node
now you can do something like
That's so amazing
oh yeah, instead of smooth from white to black
How to do the "< 0.1" ?, i have done the distance of output from modulo and 0.5
that just gives me much black lines
i put step node, but that's not lines, it's like triangles
To get a line of fixed width, you'd need to vary that "Edge" value on Step
Try dividing 1 by the radius and plugging that in
oh
This will halve the angle every time the radius doubles
oh ok so i take off the 0.2multiply
it does something
like it's not completely white actually, but the output is.. weird
now adjust the values
divide a different number by the radius
see how the output changes
mess with it!
There you go
So that's the angle part
You'll also want to use the radius to decide where to draw lines
e.g. always fill in very close to the center, and stop drawing them past a certain radius
That's basically what my shader graph does
It decides if it's "in bounds" based on both angle and radius
If it's close to the edge, it draws a black pixel; otherwise, it draws a gray pixel
and if it's out of bounds it draws nothing
U guess that i have to do the same shader that u gave me before ? lmao
i'm' gonna die
it was too much complicated
you've already got half of it, really :p
Except that when i create a material, and put it to my image
before, i had something, now i have nothing lmao
i'm too fckg dumb
I thought it was connected to base color
there we go
So to have straight lines, i have to add what ?
oh, I just realized step is the wrong function
you want to compare the value coming from "Distance" to the value coming out of "Divide"
if it's less, you draw the line
huh
u lost me
So distance has to be plug with the divide result
not on step node, but on another one ?
Trying to use a content size fitter in my layout group for these images. That works just fine, but, unfortunately, I have to rotate this gun sprite 90 degrees, as it is imported at that straight up and down angle for other unrelated reasons. When sprites are rotated 90 degrees, the content fitter is unaware of this, and applies the height to the fitter as if it were not rotated, causing that big gap between the text and image.
It's a long shot that there is a fix, but I wanted to ask just in case.
that's it
huh comparison ???
yes. to compare two values.
try plugging it into the color output (:
your computer won't explode if you plug the wrong thing in
yeah i know lmao
any chance that checking "Use Child Scale" on the layout group changes anything?
I haven't thought about rotating UI elements much
oh i have this now
hmm, that's still not what I was hoping for
show the entire shader graph
Unfortunately not, but that would have been cool.
you're subtracting one coordinate from 0.5 and subtracting 0.5 from the other, by the way. that seems a bit odd
just set the "Center" on the polar coordinates node to [0.5, 0.5] and get rid of those two subtractions
Also, you aren't using the radius at all
yeah that's why i'm confused
The radius is supposed to be plugged into Divide
not just a constant 2.02 or whatever
fuss with the constants (e.g. the "1" here)
try increasing or decreasing it
You could add a LayoutElement component to the image to manually specify the space you want
I'm not sure how you'd query that from the Image component...
By varying the number you multiply the angle by, you can change the number of segments
And by varying the number you divide by the radius, you'll change the thickness
Now you just need to write a similar graph for the radius.
u mean for the alpha ?
Right
Yep. I think it's not aware the image is rotated. Which is ultimately no big deal as I can accept the extra gap.
well, hang on a tic...
You've got the content size fitter on the image itself
I'd expect that to be on a parent object that has a layout group
something like...
Yeah, I just removed it.
Ah, I see
It's also not the source of the issue, which would have been easy, lol.
- Content <-- ContentSizeFitter, VerticalLayoutGroup
- Image <-- LayoutElement
- Text
- blah blah text
If you ever see this warning, you're doing something wrong, btw
That's not necessarily true, as even the unity documentation laughs at that warning given it's how groups of fitters are used for flexible layouts. But in this case the fitter was not doing anything.
where is that?
When you're nesting content fitters in layouts with content fitters, the warning is not legitimate. I use it all the time for panels of panels that are flexible.
There are superior implementations other than vanilla Unity. However it's all custom code.
I did something with comparison, and plug it to alpha value, but not it does a circle lmao
a ContentSizeFitter is necessary if you don't have a parent layout group controlling your size
if you have one, then your parent is responsible for resizing you
Slamming ContentSizeFitters into places they don't belong sometimes works, and then sometimes it gives you weird results
yep, since the alpha goes to zero if the radius gets too big
Yeah but with a comparison like this, it's not really a circle, it's an ellipse, and i didn't understand for the transparency btw
Forgot about the size
that'll do it!
the radius and angle come from the UV coordinate, not from a position in the world or anything
so squishing the image will also squish the circle
Yeah, so it's a circle, but i want transparency on the background
to have an image behind
And also, if i do 3 parts, the line is wider than 12 for example
Yeah -- you might want to factor in the number of segments when calculating that angle limit
The (modified) angle is changing more rapidly when you have more segments
So the lines get thinner
yep, i should do some calculations on script, it's ok
that can be done in-shader
really?
But actually, my circle is made by this
And the float that divides angle, if i change, it changes the size of the circle lmao
Only when calculating the angle limit. Dont use the result anywhere else.
okay okay
oh it works actually, i made it from the polar coordinates nodes, and i have a circle x)
i made alpha by myself
let's go
Someone know how to fix this ui problem?
The message is visible in the Scene but not in the Game
why in the ui builder I do have the placeholder but not in game?
for some reason only on this page this button does not want to work
using UnityEngine;
using UnityEngine.SceneManagement;
public class NextLevel : MonoBehaviour
{
public void goToScene(string sceneName)
{
SceneManager.LoadScene(sceneName);
}
}
this is the script i used and when i'm in game it does not change the scene
does anyone have an idea on how i could fix this?
i just copied the other scene and it just works lol
The buton may have been blocked by another UI element
You were missing the Event System
Oh in Unity 6 ic
For some reason when i'm trying to work with user interface and vertical allignment I met this problem where the items are having a huge space apart from each other
The green line is the size of the panel
this is the size of the text
this is the setting of my vertical layout group
I set it to middle center but it is not in the middle for some reason
but somewhere in the middle of middle and lower
https://www.reddit.com/r/unity/comments/ripvmi/image_fillamount_where_is_it/
This is from 3 years ago, so Iām not sure itās what your issue is. Iām pretty sure you had to download the UI package as well before Unity6
Ahh, ill take a look thank you
Can you show your rect transform as well as object heiharchy?
np
I mean the rect transform component on your textmesh ui object
I'm using the legacy text
how do I see the rect transform component though
owhh nvm found it
and this is for my text
I have three objects inside the vertical allignment
but for some reason due to the padding that goes too far
it have overflowed and went below
Uncheck child force expand height and check use child size height
yeah -- the default layout group settings are very funny
It works now
Thank you so much
What is the reason behind that though?
It seems like forceexpandheight without a content size filter expands the childās filter size(i.e. size the filter uses to seperate children) to the size of itself.
Although this is only my best guess
Force Expand means that children are given left-over space even if they didn't ask for it
This can kind of make broken UI setups work
But it falls apart very quickly
Yeah it works for my other panel but broken in this
The rule of thumb is that every object with children should have a layout group on it that controls the size its children.
well, every object with children of varying size
I'm not sure whether this should be posted in this section or not but I have a problem with the colider
It gives me this error
BoxCollider does not support negative scale or size.
The effective box size has been forced positive and is likely to give unexpected collision geometry.
If you absolutely need to use negative scaling you can use the convex MeshCollider. Scene hierarchy path "Environment/Interactable/Destroyable/Destroyable To Room Set Box/Warehouse Crates (7)/Box 1"
and based on the object
There is nothing that have a negative value or so
#āļøāphysics Check your parent negative scaling.
Thank you
yeah the parent's z axis is being scaled at -1
and when I try to scale it back to 1
the x and y became -1
š„²
from imGUI to uGUI and now UI-toolkit, personally I still prefer uGUI "but" it could surely be improve like the NovaUI package.
How can I set the image correctly? It always showing the first slice. Is this a bad practice to group them?
Is there a way to show children of a viewport outside of a viewport?
I have a scrollable list inside a viewport for equipment from which the player can drag their equipment onto equipment slots. However, since the equipment is inside the viewport, it is hidden while dragging. See video for explanation
I could instantiate a GO on click and drag that, so the draggable object is always outside of the viewport, but it doesn't feel like the most straightforward solution
By default it's not an issue. You appear to be using a Mask?
But often for click and drag stuff I cheat and use Graphics.DraeTexture or something
Yes, I am! The default UIMask at the moment
I'll look into DrawTexture later on, thanks for the tip
Ui ux dream is nightmare for dev
well the mask is the reason it's not drawn outside the mask
Yeah, I remember from working with Shaders.
I just read that Sprites can be rendered outside of the Mask since they're not UI based, so I might try that if it's not too bad performance-wise. I've got a couple of things to test now, will do that when I have time next week!
Hey guys! How do you do a similar thing in a 3d game?
I've got this for some reason.
- A texture on a quad
- World Space Canvas
- SpriteRenderer
Take your pick.
SpriteRenderer ?
Yes?
Bro Why is it that when I rotate the shelving unit 180 degrees so that it faces me with the shelves, the price UI is dumbed down
What properties are these? (Left, Right, Top, Bottom)
They are Left Right Top Bottom š¤
I mean in scripting
There's no RectTransform.Left property for example
They aren't actual properties. They are just part of the RectTransform inspector
How do I modify them in script?
Am I correct in assuming that for something like headplates, the best approach is still to place them all in a single screenspace canvas and update their positions on a frame-by-frame basis?
That's how I'm implementing them in UITK currently but looking to migrate to UGUI (or Unity UI as it's calling itself these days) and vaguely recall canvases being quite expensive to spin up
Im making a mobile game and my sprites look pixelated at 16:9 aspect ratio, and even worse at 2K resolutions. What could be the reason? I would like to have hd and sharp sprites like many well known mobile games. Also in the case of the UI and its animations the PPU doesn't affect, since I adjusted the images using the rectransform component, could this be the problem?
What's a headplate?
Use a pixel perfect camera and Point Filtering instead of Bilinear
Sorry, meant to say nameplate - UI elements anchored somewhere in the 3D world (e.g. above NPC or player heads)
It can be tricky because performance with a lot of moving UI elements can be really bad
Not that I know a better way off the top of my head but I had an issue with a similar approach once
I'm seeing OK performance with the position updating approach on UITK, I'm more wondering if worldspace canvases still perform like trash once you have more than 3 or 4 on screen at once.
If I use a pixel perfect camera (with the canvas in screen space - camera) many elements of my UI (specifically those that appear through animators) are never displayed. Also setting the render mode to Point No Filter just makes them look more pixelated.
Also what I noticed is that if I set an aspect ratio in the game view (16:9, 18:9) the sprites look good, but in fixed resolutions (including 1920x1080) they look low quality, do you know why?
In my first message I said they look bad in 16:9, although that was just the profile picture sprite which I think was too small (in PS I scaled it to 1024x1024) and now in the aspect ratios it looks good, but not in the fixed resolutions.
Perhaps it is the PPU or the size of the rectTransform of each image that lowers the resolution when scaled down.
hi guys
What is the correct way to do it, first create an empty object and then canvas in it?
and also a different canvas for each panel?
the correct way to do what?
That wasn't a yes or no question.
I want to know how to make a proper canvas if I have a lot of panels and so on
Learn how to make a main menu using Unity!
ā https://www.assetstore.unity3d.com/#!/content/84126?aid=1101lPGj
ā Developer Forum: http://forum.brackeys.com/
ā¤ļø Donate: https://www.paypal.com/donate/?hosted_button_id=VCMM2PLRRX8GU
Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·Ā·
āŗ Join Discord: https://disco...
In such and similar videos I did not find the answer to my question!
How to do a layout group where one element takes up 75% of the space and a second takes up the remaining 25%? You can 'use scale' and set one scale to 3, but that makes all the elements have stretched scales as well.
add a LayoutElement to each, enable Flexible[Width/Height] on both, set first one to 3 and second to 1, ensure layout group controls that dimension
thanks
Alternatively, if you want exactly 75% of the space to be taken up by one element, don't use auto-layout at all
Just give the two RectTransforms custom anchors
Normally, the min and max anchors are either together (thus, no stretching) or at 0 and 1 (to fully stretch)
but you can pick some intermediate value
Making a scrollrect that would snap to its elements, kinda like a scrolling date picker wouldn't be very trivial, would it
thinking of recreating something like this using a scrollrect
hey guys, I am having a problem where tags don't exactly work in text mesh pro
You need to illustrate the problem and explain what do you mean for someone to answer
was getting a screenshot
I clearly have the Override Tags option enabled, but its still not working
I've even tried the fonts supplied with TMP
override option is to override rich text tags
isn't the <color> tag a rich text tag?
it does the opposite of what you want it to do
Do you get error in the console?
or warnings
Copy/pasting <color=āredā> from https://docs.unity3d.com/Packages/com.unity.textmeshpro@4.0/manual/RichText.html can throw errors because (u201D) quotes are not supported by the font asset. Type quotes yourself to fix.
sorry for the late reply, there are no errors in the console, and the tag is completely hand written
I've even tried other colors, and even hex codes
make sure override option is off, did you type those quotes yourself?
override tells it to ignore rich text tags
I thought override tags should be on not off
sorry for the confussion
thanks for the help
someone should really update the docs
they're really confusing tbh
https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/script-LayoutElement.html on layout group items to constrain them
I've poked and prodded, but I can't figure out how to fix it.
What font is that?
roboto
lol I'm stupid. Same font I'm using, but it looked different because glow
Some options work in conjunction with layout group. If you are looking for specific behavior experiment with both.
complicated, could you record a mini-course for me?
There are plenty tutorials for it. Just have to look them up.
I did a search and I don't have what I need.
the anchor was standing, and it wasn't working, but I fixed it.
Change the pivot point.
specifically, put the pivot point at X=1, Y=0.5
This will cause it to grow to the left (since its origin will be on its right)
Guys, hello! I need help. I'm trying to use a world-space canvas on top of a screen-space overlay canvas. However, I've realized that the overlay canvas is on top of everything, so my UI won't show up. When I try to change the overlay canvas, the camera only shows a black screen. Also, I'm using a render texture on the main camera. Does anyone know what to do?
:[ you see the pathetic bag?
thats supposed to be an ui element, i dunno what to do
When I try to change the overlay canvas, the camera only shows a black screen
What do you mean? What change did you make?
What's your end goal here for everything?
its a 3d space with 2d sprites so the floor ur seeing is rotated 90 degrees and the pouch placed at the right of the player is being cut off when pulled below the screen. i want that to be on top of everything
to put it on top of everything you either:
- Use an overlay canvas
- use screen space - Camera canvas and make the plane distance closer than any of the objects
- Use camera stacking.
why is the text mesh pro outline color literally never shows correctly? I have to change it in order to fix, but then seconds later it changes again on the game or in the editor preview
I change to the same color just to re-apply the correct one, press ctrl+s to save and the color changes back to a brighter version
https://discussions.unity.com/t/textmesh-pro-colors-highly-inaccurate/746794/46 Tried doing the shaders update mentioned in this but for some reason the colors shows the same. I had to use the script tool the user made to convert the correct colors
And just like he said "Canāt believe we have to do this ourselves for such an old bug, thanks Unityā¦"
Does it still happen with the latest TMP in U6? Supposedly it can now respond to the āuse gamma colorā checkbox on the canvas.
It still happens unfortunately, even forcing to use gamma color :(
I find your particular color deviation to be a bit extreme relative to what a gamma issue would cause. Itās not a camera or world space canvas or non-ui TMP component, subject to post processing, right?
I agree with you, but I believe the issue resides with TMP because it happens even on a brand new project. The little tool to 'convert' the color to use in TMP just subtracts the color in power to make it darker, and it works, so I believe to some extent it is a gamma issue lol
So is it related to HDR colors?
It is in the mobile shader, which is not HDR
but I do remember this behavior on the normal shader as well
Dose anyone know, why my buttons just became invisible?
from the information provided... no
Do you need the inspector and hierarchy details? @low pike
that would be a good start..
hi, i got a problem with ui animation. I made an animation on button on highlight but i doesnt work. Only pressed animation work.
Image
tried somethings found on internet but nothing worked. Tried disabeling some of the objects but nothing
This is just one part of the configuration. You need to show your animator state machine and how you set up all the states and transitions
The only thing the button component does here is set triggers in your animator
realistically - this is probably an #šāanimation question.
Are those transitions all set up properly?
with the right conditions
(are the triggers set up properly?)
umm, i dont think so? i've seen now that if i have click pressed and hover over button it gets highlighted
well it's not going to work without you setting those up
i tried setting them like this
I have no idea what this screenshot is showing
you need to open the Parameters tab in the Animator window
make sure you have set up triggers with the names you are using on your button component
And then have transitions in your state machine (the transitions are the arrows) use those triggers as the condition
hey i'm making a textmeshpro button
how do i round the corners of the box more?
-# please ping once you reply
Import a sprite with rounded corners
Or use spriteshape to create one
Is there no way to just increase it through properties? It automatically rounds it like that
There's nothing automatic about it. You are using a sprite image with rounded corners
Oh, okay, thanks.
Every time I try to make a layout group of other layout groups (for example a horizontal layout group where the children are vertical layout groups) the parent layout gets all messed up - the children layouts seem to override it. So the children elements will be different widths and/or the total width will exceed the parent group, etc
Anyone know why this happens
mobile doesn't have/ need/ can't do a highlight state.. there's no pointer/ cursor to do 'on hover'
how do i disable selecting on a button with textmeshpro? i set the alpha to 1 for selected color but when i click, instead of setting it to pressed color and then highlighted is sets it to invisible ā
https://www.reddit.com/r/Unity3D/comments/2u89py/any_way_to_avoid_selecting_a_ui_button_when/
yeah, i was thinking the same when i went to sleep. thank you
okay ill send it over in a sec, just rendering a scene in maya.
zero need to reply and ping me with that..
just found that all the text and input fields text objects have a NaN.
I was wondering if anyone could help me with this image problem I have been having in multiple projects of mine? where even though the image is way bigger than the canvas it still shows partially what the camera sees (The yellow)
what is this supposed to look like? I'm not sure what we're looking at here tbh
ooh sorry its supposed to be a fully black screen but part of the camera for some reason peaks through even though the image is way way bigger than the canvas
can you show the canvas/image setup?
Yea it was just a test unity project to try to fix the problem so there is not much
good! that makes it easier to diagnose the problem
Here is the canvas
idk if you need this but here is the image to
this is the inspector
do you need anything else?
instead of scaling the image up a bunch, just set it to stretch on both axes and then give it top/bottom/left/right values of zero
like this
(although, I wouldn't expect a scaled-up image to have the problem you're seeing)
Have you checked if the problem exists on the build version? Sometimes preview in Unity editor has minor glitches.
someone played our game today on twitch and i saw a weird flickering in the UI which i never saw when playing myself.
Does someone know what can cause this?
https://www.twitch.tv/videos/2343105147
At Time 4:31:10
Looks like a floating point precision error. Such flickering could happen if the center of the pixel has 2 values next to each other. Imagine that you have a pixel, but you try to display one color on the left side, and another color on the right side - it's unclear what color should be use, since both values are next to the pixel's center. Technically, moving the UI element by 0.001 px to the left or to the right would solve the problem, as the edge would no longer be in the middle.
For testing purposes, I would suggest figuring out what resolution was used on that stream, then test the game on the exact same resolution. Keep in mind that fixing it on one resolution might break it on a different one. But as the shape of UI more or less overlaps with the shape of area covered by pixels, it should look good.
Thats whai i thought too.
I tried it by simulating 1080p in Unity, but i dont get the same problem like the streamer got.
Feels like simulating 1080p on a 4K Screen in unity is not the same ^^
But i will try to move the UI ELement just by 0.001 px ^^
I think running the build in a window could help to test some edge cases. Sometimes editor displays things differently.
Is there any easy way to flip an Image? For a sprite there's a flipX flipY, but not for image and it's annoying. Only thing I can figure out is rotating by 180, but that screws up all the children and/or layout groups.
for example I have this and if I want to use it in 4 different directions..
u can open this image on sprite editor, and place the anchors on all four corners with a bit of padding, and then u can adjust it from the inspector by changing the image type
I would probably just make a rotated copy in Gimp
seems like there's nothing better
I wonder why flipX flipY isn't a thing for images
You could write a really simple UI shader to do that
And by "write" I mean "make one in shader graph"

