#📲┃ui-ux

1 messages · Page 27 of 1

midnight helm
#

But this doesn't work when I am using anchoring. When I use a samsung fold phone, the entire interface breaks and everything is out of place

jagged monolith
#

That would indicate they are not anchored correctly

#

You should use the deivce simulator in unity to try different resolutions in editor

paper niche
#

anyone know how to stop post processing affecting the UI ?

low pike
#

put it on a different layer, probably

scarlet ether
#

hey guys good morning/evening/Afternoon.. I have a scroll menu where the white blocks will be like information .. but the scroll only works when my mouse is above the white part.. when its in between where there are black spaces doesnt work any ideas?

gentle osprey
#

good morning!
having some issues with my scrollbar & Scroll Rect, namely that I am unable to interact with the scrollbar despite the scrollbar having interactable checked off, I can provide any info needed on why, Ive been trying to get it to work for ages h

#

nvm, figured it out! forgot to assign a graphic raycaster lol

honest saffron
#

@scarlet ether looks like ur following the exact same tutorial as this guy and came across the exact same problem

willow swan
#

Trying to decide on how to implement this. Am I overthinking it? Yes.

Would having a UI's current 'screen/layout' or 'popups' event assignments and stuff stored in ScriptableObjects make sense?

I am not quite yet wanting to make the game's UI fully modular and populated via XML or JSON, I'm just trying to find a way to store an instantiated UI prefab's children's UnityEvent assignments.

scarlet ether
scarlet ether
#

Hi guys.. I have an UI Text. Even if I play around with anchors or use Best fit. when I increase or decrease the game window everything scales and adapts to the window size, but not the text, the text remains with its original size. Even playing around with Best Fit and setting a minimum and maximum size.. any ideas?

hazy smelt
#

how do i allign the number to be on the right side instead?

quaint vigil
#

I need a way of doing loading a font at runtime and to store it into a font object for usage.
The font "wont be installed on the system" in the normal sense or in the a way Unity could recognize.

Cant find much online but people using TextMeshPro and I'm new to Unity and unfamiliar with that.
I am using Unity 2017.2.0p2 and .NET Framework 4.6 and IL2CPP and I cant really change any of that.

Found this bit of code: ```cs
var font = Font.CreateDynamicFontFromOSFont("NAME", size); // NOT TOO SURE WHAT SIZE IS FOR
string[] fontPaths = Font.GetPathsToOSFonts();
Font osFont = new Font(fontPaths[124]);
TMP_FontAsset fontAsset = TMP_FontAsset.CreateFontAsset(osFont);

but my version of Unity doesn't to have `CreateDynamicFontFromOSFont` or `GetPathsToOSFonts`
as they were added in 2018.3 and 2022.3 respectively 

I am building for PS4/FreeBSD Unix, read a file from lets say...
`/preinst/common/font/SST-Regular.otf` or even 
`C:\Users\User\Desktop\SST-Regular.otf`

but could also probably be tested with any other platform, as I don't think it would really matter?
I wanna do this as I wanna open source my project and don't wanna include any SONY property like
fonts, assets, SDKs, examples, etc etc, and the needed fonts are located on the system and would be best. 
I only use the official SDK for building and the plugins (SPRX) are built with a open source SDK.

my goal is to do something like ```cs
  Font currentFont, runtimeFont;
  void Start() {
    /* logic to set runtimeFont in runtime */
    // runtimeFont = ?????

    switch (languageID) {
     default: currentFont = runtimeFont break;
 }
}```
If you need ANY more info lmk and any help is greatly appreciated, thank you ahead of time!
honest saffron
hollow echo
#

Hello,
I develop a 2D game and I want to do an inventory UI like in Zelda Ocarina of Time
I want to have the feeling to be in a "box" when I open the inventory and can navigate it like in the game. The animation in this video
https://www.youtube.com/watch?v=Ul2ipeV5npQ

So, is it possible to create a 3D canvas on a 2D game even if I have also a 2D classic canvas ?

Zas

Place cursor on the item you want.
Press Z or R to move away from inventory.
Move back into the inventory screen (recommend using Z or R)
If coming from map screen tap up left and a C button right before the screen finishes scrolling.
If coming from equipment screen tap up right and a C button right before the screen finishes scrolling.
The topm...

▶ Play video
teal wedge
#

why can't I select my function in the On Clic () list in the button?

#

the function is public

mortal robin
mortal robin
#

Did you drag the correct object into the slot, for example?

mortal robin
#

On click requires no parameters for a dynamic call

#

Or for you to assign a parameter statically

teal wedge
mortal robin
#

Can you show the second thing I asked to see?

mortal robin
#

You dragged in the script itself

#

You need to drag in an object with the script attached to it

teal wedge
mortal robin
#

No

teal wedge
#

thankks

#

thank you very much!!!

tawdry ferry
#

Hey, on the following image, a Vertical Layout Group is used on the blue button to control the text height. Is it possible to make the height match the text's pixels?

hazy edge
#

I believe with the Content Size Fitter component

#

then set Height to Preferred Size

#

@tawdry ferry

tawdry ferry
hazy edge
#

then I don't understand the question

#

either the Vertical Layout Group controls the height, or the text object controls it

tawdry ferry
tawdry ferry
scarlet ether
pliant crescent
#

hiya! what component do I need to add to a button in a vertical layout group for it to get the padding attributes?

tawdry ferry
pliant crescent
#

that seems like it controls the padding on the element it's on. so if I have VLG2 inside of VLG1, using padding attribute on VLG2 moves VLG2 independently, not its children. or maybe I'm whack.

#

is there a way of offsetting the position of an element inside a VLG?

#

I hope that explains it, it's late and I don't wanna upload a video 😦

tawdry ferry
pliant crescent
#

That makes sense

honest saffron
#

i can make a random guess though, maybe the text is the 3d version not the ui version?

torn sparrow
#

Hey guys. Trying to make some UI art for the first time.

This is it rendering on the game window, is it some settings off or do i is it a design flaw, too tight strokes maybe?

The close button is very pixelated and the little rectangle strokes too

#

Basically everything that isnt a perfect rectangle gets pixelated

mortal robin
radiant turtle
#

Anyone know how to fix the jittering of the text? I am using rich tags on the textmeshpro text boxes to increase the size of the newest character as its typed

mortal robin
#

That way it will do the layout properly - and only once.

radiant turtle
radiant turtle
ionic beacon
#

It's jittering because changing the font size changes the line height. Set the line height manually so that it won't react to the font size

radiant turtle
desert wyvern
#

Does anyone know how to use unity with dear imgui? I followed the youtube tutorials but I kept getting errors.

ionic beacon
desert wyvern
#

its not working

mortal robin
#

What a vague and terrible problem

mint saffron
#

Can anyone explain why there are no changes in inspector when I'm stretching the text? How do I change same thing with inspector?

mortal robin
#

not the RectTransform

mint saffron
#

yeah, I've just found out it was under "Extra Settings" button

mint saffron
#

But I don't quite understand what is the difference between this margin

#

and this one

signal viper
#

Reaching out here as this little nugget has me stumped now.

Got a simple registration screen which has multiple TextMeshPro InputFields. However, when you try and move from field to field, the mobile keyboard is constantly closed (as if the close keyboard event happens AFTER the open keyboard event for the next field.)

Tried several techniques now to override the "lost focus" behaviour of the input field when another field is selected (obviously want to retain the behaviour if the user clicks anywhere else).

But this is beyond frustrating now. Anyone got any ideas?

#

OK, found one workaround but it looks really janky, by having a coroutine on a delay to open the keyboard when a field is selected.

signal viper
#

Hopefully there is a better way?

late egret
#

the sprites that got turned on there side didnt get their offsets corrected, but the ones that just got fliped upside down did
is it a sprite issue or a coding issue?

torn sparrow
urban crescent
#

What's the best approach for creating a UI that will be binded with the player data, for example gold and gems? The same values could be displayed in different places, such as shop menu, or upgrade cost menu.

I feel like there's multiple approaches but I don't know which one is the best for scalability.
Should I architect the UI as a component based system, like UIPlayerGold.cs and UIPlayerGems.cs, and those will subscribe to an event like Player.OnDataChanged += UpdateUI, that would goldText.text = Player.gold.toString()?

I think UI Toolkit has data binding built in, but I'm using UGUI. I hope someone can give me a proper example to build off from.

mortal robin
mint saffron
#

How can I make an UI visible and interactable both in vr and on the screen? I used just one worldspace canvas for it, and just made it float in front of active camera, but the problem is that I can't even make worldspace canvas to be interactable just on screen (I haven't tried to make it interactable for vr yet), I have 0.001 scale on that canvas, and It's actually clickable only if I set the scale to 1, and if I set the scale to something in the middle, like 0.5 or 0.1, then the smaller the value, the stranger inputs work, I mean like there is something like offset
UPD: Turns out it's happening when headset connected, strange

stone pollen
#

Why does the UI Navigation go always crazy on startup of the game?

They instandly start looping / spinning their current selection, until I press a ArrowKey or click with the Mouse in the Background.

It looks bad and will of course confuse the player.

It is caused by the UI Navigation but I need it still because I want to let the player go around in the menu with his Gamepad, without switching to the Keyboard.

  • How can I get rid of this looped flipping behavior of the Navigation?
mortal robin
#

The problem is likely some errant input device sending a down signal

stone pollen
mortal robin
#

If you're using the new input system, try using the input debugger

#

If the old system, log Input.GetAxis vertical

rapid ferry
#

Can we automatically make an image contain a text and fit with the content without a layout group in unity2022?

low pike
#

always could

grim breach
#

I have a 2d station at the end of my game where I want to merge a before taken foto with an overlay and over the overlay i want to show how long the player needed.
The combination of the foto and the overlay works fine. The problem is to get the textmeshpro over it.
Build up.
My parent is a canvas element with screen space overlay.
I have a gameobject with a camera and two sprite renderer to combine the image and the overlay.
My question is now how can I add the text over it.
I tried already to play with sorting layers but that doesnt seem to work

mortal robin
#

If you want a sprite to show over it you need to either put that sprite in an Image component on another overlay UI element, or switch to screen space - camera

stone pollen
stone pollen
mortal robin
#

Some of those devices act like... Keyboards, mice, and extras

grim breach
mortal robin
#

And you're using an overlay UI

#

Overlay draws over EVERYTHING

onyx nacelle
fading fractal
#

Is there a good way to make a particle system behave like a UI element, allowing it to be layered above or below other UI elements (visually) and be maskable (scrollview) as well?
I've been looking for such a solution for long time.

sharp rock
#

Why is the UI on the scene high quality but on the game it's so pixelated

#

I tried everything from changing pointer filter to max size 16384. The only thing that seemed to fix the issue is scaling the UI bigger relative to the camera's current size, but I dont want the card to cover the entire camera's view

sharp rock
#

Nvm fixed it by disabling low resolution in free aspect

mortal robin
scarlet ether
orchid arrow
#

i got a new pc and got my unity projects on it but when i try to open a unity project i find out that the ui is in a wrong place, half of it is out of the screen and it's so big without changing anything, do anyone have a solution for this because there is much ui and i can't do it again from scratch

honest saffron
open lily
#

Can someone guide me to how to access the gallery thru unity, lets say i want to make a profile system or logo so that player can choose an image from their device,
if u can guide me to a tutorial or if it is somewhere in unity manual,
thanks

keen roost
#

What do I have to change in my setting, that the 2 balls keep the position as shown in the video, but also change size proportionally when I scale them with the rect tool?

scarlet ether
eternal fox
#

does anyone know how i can make a 3d button like this in unity (using blender as the concept idea)

#

ive tried just replacing 3d objects as my buttons but it still dosent work

#

nvm

sharp rock
#

Does anyone know why this occurs? The child UI elements of each card is overlapping the other cards. Sorting order for all of them are 0. Setting sibling index doesn't fix the issue.

mortal robin
#

Lower in the hierarchy==drawn on top

sharp rock
#

Yes but this does not occur with image sprites. I mistakenly used sprite renderer for my sprites instead of image component

desert hound
#

https://puu.sh/KfqKk/ef501fbb4b.png
I have tried to work a bit with UI. I have made this little box that says "This door is locked.", and I've tried to remove it from the game view. I tried to delete it in the scene view, but it still shows up in the game view. How do I get rid of it?
Sure, it doesn't show up when I start the game, but I feel like I'm doing something wrong and it would be a struggle to work with UI if I can't get remove them from game view?

paper hearth
#

I'm creating a Twitch Chat Reader which has support for emotes. Players would download emotes, it would be packed into a single texture atlas, and then a TMP Sprite Asset sheet would be generated taking in the atlas and be used for a Text object. So far Ive got everything to work except for assigning the atlas to the TMP Asset. I am able to create sprite characters and glyphs with each emote on runtime and I can assign them to the asset but I am getting a Type Mismatch when assigning the texture2D atlas to the sprite atlas variable. I've tried changing up the property settings when initializing the Texture2D and tried casting it as a regular Texture when assigning it but nothing seems to work at all

urban crescent
#

In horizontal layout group, is there a way to add individual top margin to a specific element?

For example, I use a horizontal layout group for message bubble and player profile icon. I'd like to make the player profile icon have an extra margin at the top to make it align nicer with the message bubble. (Slightly move down the player profile icon.)

pliant crescent
#

I have two text mesh pro elements. changing the font colour of one always changes the other as well, I've never worked out what resource they're sharing that causes this. how do I fix it?

#

ah, finally found material presets

vivid path
#

Hi. I have some scenes with canvases loaded additively in my project. Is it possible to change the layering of the scenes programatically so that at a specific point one can go behind the other. Like this... https://youtu.be/zza73OWyuJk&t=129

Thanks in advance.

low pike
vivid path
vivid path
#

Works great! Still have a few bugs to sort out (relating to my system not the sorting order) but otherwise is perfect. Thank you!

woven pike
#

Bizarre issue where buttons broke and basically slapping the Canvas fixed it... anyone else?

  1. opened project
  2. buttons didn't work - wouldn't even highlight if mouse cursor was over them
  3. eventually disabled old Canvas, created new Canvas, ran game with new Canvas
  4. disabled new Canvas, re-enabled old Canvas
  5. button in the old Canvas now works

This happened in two different scenes. A brand-new Canvas works fine.

I'm a bit concerned if I have to potentially disable/re-enable anything that's acting weird?

mortal robin
#

when you create a canvas from the editor menus, it creates the event system for you automatically, so that's what happened when you recreated it.

#

This is a very common mistake people make.

urban crescent
# mortal robin Use layout elements

Can you show an example setup? Layout Element seems to only control sizing, and using Ignore Layout would break the layout. Did you mean I have to use extra sizing on the profile icon to make it appear more down, is there no way to set offsets/margins for the position rather than sizing?

mortal robin
urban crescent
lapis ledge
#

When you are adding elements to a vertical layout group i wonder how to have it automatically resize to fit all the elements. the size is important because it decides on the ScrollRect handle settings. and i need to dynamically change this list at runtime.

edit: Content Size Fitter with vertical set to min preferred, and setting spacing in the vertical layout group to 10 made it work perfectly.

woven pike
stoic hull
#

hi guys, why Alignment option in TextMeshPro doesn't align my text? Whenever i change it nothing happens

ionic beacon
#

Does the text have enough space to move? Does it have only one line?

ionic beacon
#

Show a screenshot with the object selected and the inspector visible

ionic beacon
#

Title text style overrides the alignment for some reason

dense crystal
#

How do you enable pillarboxing for games? I want my game to be able to maximize to full screen with black bars kind of like this

#

But right now it's this due to the settings i have

#

Is this a setting somewhere?

#

I do not want it to be responsive because its an interactive animation and it must be in this 9:16 aspect ratio to work properly

mortal robin
#

I don't think there's a setting for it

steel hedge
#

On Unity's Vector Graphics page https://docs.unity3d.com/Packages/com.unity.vectorgraphics@2.0/manual/index.html,
in the Known Limitations section, it says:

Per-pixel masking is not supported (SVG 1.1 section 14.4)

I am trying to use an svg as the background image of a button within a scrollview that has a rectmask2d.
The image only either fully shows or fully doesn't show. If I instead use a png, the mask works correctly.
Is this an example of the not-supported feature, and does this mean I should just... not use vector graphics for this purpose?

attached image shows the text being masked properly within the rectmask2d, while the svg does not.

pliant crescent
#

I'm trying to do a quick list of what expected content is missing from my game. I'm using the resource locator to check if a path exists in addressables. It's coming back with the first half of the content NOT existing, even though it does. I put in a 3 second delay which should be heaps, and the content seems to be loaded and available well before that anyway. can anyone see if I've done anything obvious wrong?

private IEnumerator CheckWords()
{
    yield return new WaitForSeconds(3.0f);
    yield return CheckForMissingSlowWords(StoryLoader.PersistentData.Config().PrimaryLanguage, PrimaryWords);
    yield return CheckForMissingSlowWords(StoryLoader.PersistentData.Config().SecondaryLanguage, SecondaryWords);
}

private IEnumerator CheckForMissingSlowWords(PandB.Types.Language Language, PandB.Types.StoryPage Page)
{
    if (Page.Words == null || Page.Words.Count == 0) yield break;

    foreach (PandB.Types.StoryWord Word in Page.Words)
    {
        string assetPath = "Assets/PoppyAndBuddy/" + "Stories/" + Story.StoryName + "/Audio/" + Story.StoryName + "_" + Language.ToString() + "_" + Word.MatchWord + ".wav";
        if (!AddressableResourceExists(assetPath))
        {
            Debug.LogWarning($"SlowWords: missing {assetPath}");
        }
    }
    yield return null;
}

public bool AddressableResourceExists(object key)
{
    IEnumerable<string> locs = Addressables.ResourceLocators.OfType<ResourceLocationMap>()
    .SelectMany(locationMap =>
        locationMap.Locations.Keys.Select(key => key.ToString())
    );
    if (locs.Count() > 0) return true;
    return false;
}```
#

weirdly this was working earlier with minimal differences

analog urchin
#

Hi guys, how do I make text scale vertically (Appears like the only solution is a content size fitter) inside a vertical layout group that also uses a content size fitter to scale vertically?

#

Having 2 content size fitter stacked seems to mess things up, looks like a matter of the outer one updating before the inner one, but I can't confirm that.

#

I need it for tooltips, basically when you hover your mouse over an item, a tooltip will show with the title, and a description with varied length

analog urchin
#

My theory was correct, and I ended up fixing it by whenever I set the text, I'll call descriptionSizeFitter.SetLayoutVertical(); right after, thus avoiding the race condition

#

This can be executed when the content size fitters are disabled too, which could be a slight performance buff in some cases

trail laurel
#

how can i turn this image into repeating "tiles" so that i can change the Y offset and it would look like its spinning

mortal robin
trail laurel
#

sry im not sure what u mean

mortal robin
trail laurel
#

yes

mortal robin
#

the shader will need to also support tiling

#

not sure if the default ui shader does

#

but basically - make a material with the ui shader, and set the texture offset in your code

trail laurel
trail laurel
mortal robin
#

easy enough with shader graph

#

all you need to do is uv = uv % 1 (but in a graph)

trail laurel
#

ill try to figure it out, have never used this before tho

snow junco
#

I have a canvas with a prefab child with some ui info panel, I have one permanently for debug purposes when I start the game, but generally I instantiate it as info box over moving gameobjects with indicator.screenPoint = mainCamera.WorldToScreenPoint(target.transform.position); and RectTransformUtility.ScreenPointToLocalPointInRectangle(containerRect, indicator.screenPoint, null, out localPoint);
this generally works perfectly.
But I was playing with filters and volume settings and tried switching my canvas from screen space - overlay to screen space - camera: and it breaks. With the canvas set to overlay camera the "static" prefab still works and is displayed and filtered, but the ones I position with my code aren't visible and in the scene view I can see they're not even oriented towards the camera like the first one?

mortal robin
snow junco
# mortal robin With screen space camera you can just directly do `indicator.screenPoint = targe...

I don't see how this can possibly work, the working ui elements have coordinates within my canvas scaler 800x600 resolution. While my targets have 3d scene coordinates. it's a test scene, so yes, randomly the x,y are within the -400, 400 and -300, 300 range but this seems very accidental.

But something weird happens with the screenPoint = transform.position assignment: the actual recttransform coordinates I end up are (2700, -8000, -6000) more or less, for position that was (15, 80, 31) in worldspace. Plus when I just assign the position my indicator's recttransform ends up with a rotation?

mortal robin
snow junco
mortal robin
viscid pelican
#

Hiya!
I need to make some images multiple of 4, otherwise they don’t get compressed. I changed the pixel width and height to be multiples of four, but when I bring it into unity it changes the pixels, making it no longer multiples of 4.
What’s going on here and how do I get around it? Any help is greatly appreciated, thank you : )

viscid pelican
#

Oh! Found it, thank you!

snow junco
#

@mortal robin ah it was my ScreenPointToLocalPointInRectangle(containerRect, indicator.screenPoint, null, out localPoint); I pulled this out of the docs for my original overlay: and the docs say for overlay you pass null for the camera, so for the canvas set to "Screen Space - Camera" I need to pass the camera as the param. ( I also need to manually zero out the z param, and reset the rotation, but it works!)

solemn pivot
#

How do I use an input field? No matter what I type Im not getting a value as a return, Iget blank as a return

#

I can clearly see the blank line here which is probably the source of why im getting a blank line no matter what user inputs, but WHY is that line blank? why isnt it just passing the value forward like the method says?

mortal robin
#

you need to add it from the dynamic parameters list

solemn pivot
#

ah at the top

mortal robin
#

(check the dropdown to pick a function)

solemn pivot
#

I just found that myself as well, the top one not the bottom one 🫠

#

Thanks Praetor 👍

#

as usual the detective looks for the killer only to find out the killer was the detective all along

#

Ive got a ton of cruft all over my text mesh pro text and I cant seem to find out why, is there a document for common debugging of TMP text looking like crusty garbage?
The only thing ive been able to determine is if any kind of Antialiasing is on, the text looks like ass
Additionally if the UI camera is set to Overlay, it looks like ass, but NOT when its set to Base, so that likely means something is going wrong in the overlay proccess involving scaling? But I cant find anything related to scaling occuring

#

So far the only value that seems to improve the look of the TMP text is the Render Scale of the URP quality asset

#

which is just rendering the entire scene larger and then downscaling

#

surely there is a less resource intensive way to get good looking text out of the box

mortal robin
solemn pivot
mortal robin
#

I see, idk then

solemn pivot
#

very clear crustification as it gets smaller

#

im zoomed in viewport scale 3x here

#

the M is barely readable because its like its glowing white or something

#

maybe something in here is wrong?

#

Nope randomly scrubbing all the values has no effect on the text 🤔

#

love when features have tons of parameters that all do nothing

#

honestly it didnt USED to look this shit

#

so maybe I need to roll back

#

because something went wrong that completely @#%@^ the look of all my text at some point

#

I guess ill try that, rolling back many versions to see if the text improves

#

rolling back shows it did used to look good and crisp

#

now to go through every version until I find out when/what went wrong that killed it

#

im positive it was some setting related to antialiasing

trail laurel
#

@mortal robin i think i did this correctly but its just fully dark red outside of shader graph for some reason

mortal robin
#

Or a regular one

#

in the graph settings - make sure it's set as a canvas material

trail laurel
#

hmm that explains it lol

mortal robin
trail laurel
#

its just this ```csharp
public Renderer Renderer;
void Start()
{
Renderer = GetComponent<Renderer>();
}

// Update is called once per frame
void Update()
{
    Debug.Log("OffsetY Value: " + Renderer.material.GetFloat("OffsetY"));
    Renderer.material.SetFloat("OffsetY", Time.time);
}
mortal robin
trail laurel
#

also i used SetTextureOffset at first before using custom float OffsetY

#

both dont work

#

as you can see, it clearly works outside of the game

mortal robin
#

to be clear the object the thing is rendering on is the cube right?

trail laurel
#

yes

mortal robin
#

oh it's assigned in Start

trail laurel
#

ye

mortal robin
#

Wait I see the problem

#

I forgot

#

the thing you would use in the code would be the Reference name here

#

so _OffsetY

trail laurel
#

ohh i forgot about that

#

atlast i can rest

solemn pivot
#

@mortal robin I got progress in case you someday see someone else with the same problem.
The problem appears to be my canvas itself is set to Screen Space - Camera (crusted over broken text)
and it needs to be Screen Space - Overlay

#

except im 99% sure there was some plot critical reason why I had to set it to SS Camera UnityChanThink which im sure ill rediscover shortly tomorrow when I start to use it as Screen Space - Overlay

ebon whale
#

Can anybody tell me how to enable the mesh outlines for individual characters in a textmeshpro ui text object?

#

this is what i want to see:

#

but this is the thing im stuck on:

mortal robin
pliant crescent
frosty wave
#

why the particals are not showing on raw image

minor ocean
frosty wave
#

i have marked it

trail laurel
#

took me multiple days to make something this simple

#

someone know why theres a purple background? the image i use doesnt have that

#

also i had to add my material on a 3D object since my shader cant support UI for some reason

marble current
#

How would I put this rock sprite behind that Darkbrown UI
As they don't have order in layer

#

It did work when I played tho

#

I just don't understand in what order it works

fresh saddle
torpid garden
#

any tips on creating curved canvas?

azure flame
#

Depending on what effect you want, you can project UI to render texture and pass events or turn 3d space elements into UI through selectable interfaces.

marble current
# marble current

still need help on this StoneUI prefabs are children of StonePlacer, however stone placer isn't a canvas its just a gameobject, and none of those stuff have ordersinlayer

austere ibex
#

i just started a new project and added a text from textmeshpro, does anyone know why its kinda pixelated around the edges?

azure flame
#

You need to look at canvas settings, it uses SDF so it can be set as sharp as you wanted to be with pixel per unit settings. Could be elements too small with zoomed in game view slider if it's default PPU.

torn marlin
#

Uuuuuuuuugh, Pure catharsis.

I finally defeated the Pixel Perfect UI demon, and I figured out why all the UI demons were appearing and making my pixel art distorted and fucked up.

So, the gist of it is this, the ONLY way I could render pixelated UI before was to render it to a low resolution camera, capture the output of that camera as an image, and display that image to another, high resolution camera.

This works great, except for a major problem. The modes.

  1. In Screen Space Mode, the UI displays correctly, but at the cost of being unaffected by All Post Processing. The UI is not pixel perfect, but full resolution, and the UI is not color-crushed, but off-palette. Unusable.

  2. In Camera Space Mode, the UI displays correctly, and is affected by post processing, and is pixel perfect at the correct resolution, and color graded correctly, BUT, Raycasts do NOT work correctly, because the UI camera is at a small resolution, while the actual game camera is at a large one, resulting in the mouse being unable to click UI correctly. It will instead click UI close to the bottom left of the screen, because the raycast "Thinks" the screen is smaller than it is.

Setting Camera Space, and rendering it to the Full Resolution camera fixes this, but makes the UI non-pixel-perfect.

  1. In World Space Mode, the UI is rendered physically inside the world. It is affected by post-processing, color grading, and pixelization, but at the cost of it being imperfectly rendered, due to it having to actually render to the camera as if the camera was recording something in the world itself, leading to floating point errors and other major issues.

The solution, such as it is, is that option number 2 is the only workable one. By adding a resolution-fixer to my post-processing stack, I can render the UI to Camera Space, then use post processing to make it Pixel Perfect by rounding the UV Coordinates, instead of relying on a render texture to do so.

I hope this helps some of you.

fringe timber
#

No idea where to ask this but I have a camera with a target render texture for rendering a ui render texture image to add some filter. But whenever my CPU peaks, the render texture just freezes? Does anyone have any idea why this is

minor juniper
#

Hello. trying to create simple tutorial text that shows up for X amount of seconds, disables, then shows another, but it's not working (no console errors). Using TextMeshPro. Any ideas?

#

Oop, it was because I was disabling the gameobject instead of the textmeshpro in the inspector

white mango
#

Im trying to make a health bar but whenever I put my fill into the slide it becomes way bigger(vertically) then the healthbar, can someone please help

white mango
#

i found a fix

torn sparrow
#

God, please help me. I've been three hours trying to get a scroll rect to actually work. Right now my scrollbar always resets the size value to 0.5 doesnt matter what i do, and i cant get my handle to go the full sliding area for some reason. The content has a content size fitter component, i've tried changing pivots, making a prefab, changing the prefab, resetting the component, opening and closing the editor... i really dont know why it does this

Can anyone help?

azure flame
torn sparrow
azure flame
#

Are you adding content dynamically through code?

torn sparrow
#

no

azure flame
#

You should illustrate the question then to show exactly what's happening

torn sparrow
torn sparrow
azure flame
#

Scroll handle resizes based on the amount of content, it's controlled by the component.

azure flame
torn sparrow
#

Ok, then how would i keep its aspect ratio and have it scroll the whole list?

#

Isnt possible?

#

Id probably have to use a 9 rect for the handler wont i? @azure flame

celest lodge
#

how can i create a box to like select this with arrow keys / dpad like i drew? im using a grid layout.

azure flame
torn sparrow
#

Thank you

high tartan
torn marlin
# high tartan can you explain how you added the resolution fixer to post processing?

Okay, so, if you like, I can dig up the shader I used, but the GIST of it is this:

-preface: This is a Fullscreen Shadergraph Shader which is used for a Unity Post-Processing Effect in URP

  1. Take your blitsource input, and for its UV, put in a screenspace UV
  2. Take that UV, and multiply its value by a Vector2, your Resolution that you want to fix it to.
  3. Using Round, round the result to an integer.
  4. Divide this by the same Resolution value.

Test this by starting with a VERY low resolution, I use 10x10, which lets me see if it worked correctly. If it did, you should see the UV image has become Pixelated.

Note, this is only guarenteed to work with multiples of your input resolution. I use 640x480, but my game renders at any 4x3 ratio that is a multiple of that (In this case, 1280 by 960)

It MIGHT work for whatever, but if you want guarenteed results, make sure you're downsampling by something divisible by your final resolution. I.E, if you use 1920x1080 as your game's resolution, use 960x540 for your pixelated downscaling shader.

#

Does that explain it, or should I take some time to boot up my project and try to get you the stuff involved? I can try to make a basic shadergraph and package it for you, if you like, but it might take a while, since I've got a bunch of other stuff I handle on a day to day.

high tartan
# torn marlin Okay, so, if you like, I can dig up the shader I used, but the GIST of it is thi...

i'm completely new to shaders so I'll try to figure it out but if you find the time to send it over that would be amazing. I'm trying to achieve an effect similar to the game Core Keeper where every single element is on a pixel grid. Does this shader just solve the issue of screen space camera mode messing with mouse position/raycasts? Right now, when i use screen space camera the pixel grid is still misaligned causing weird artifacts when using upscaling. Do you know why that is? It works completely fine ingame with gameobjects, etc.

fresh saddle
#

is there an easy way of getting TMP_Inputfield.text, without the rich text tags? Or is that something I'm gonna have to code?

#

nvm i forgot I can just regex it

high tartan
#

any suggestions how to fix the text being rendered odd when using pixel perfect camera? It is on a world space canvas. As as an example, the two g's are being rendered slightly different when trying to allign to the pixel grid. Sometimes parts of characters are 2px wide when they should be 1px, etc. I believe this has something to do with the font but not sure how to fix it? Thanks

torn marlin
# high tartan any suggestions how to fix the text being rendered odd when using pixel perfect ...

This is a nightmare to fix, so I'll direct you to a video that I used to fix mine:

https://youtu.be/Ov2XR81oVcI

The steps, in order:

  1. Use a Pixel-Perfect Font.

  2. Use Raster Hinted for the font.

  3. When creating the font, make ABSOLUTELY sure you set the Sampling Point Size and Custom Size to the EXACT font-size your font is intended to be used at. I.E, if it's an 11 Pixel Font, set Sampling Point Size to 11.

  4. Set the Font's Atlas Texture to Point Filtering.

  5. Set the Font to the correct size.

  6. Use Pixel Perfect Canvas mode.

This all SHOULD lead to a pixel perfect font, but I might have missed some steps. The video goes into better detail than me.

In this video I'll show you exactly how I made my own custom pixel perfect fonts using Unity's Text Mesh Pro component. If you have any issues implementing this in your projects feel free to drop me a comment or message me in my discord and I'll gladly help you out! Thanks for watching!

Online PNG to TTF tool: https://yal.cc/r/20/pixelfont/
Dis...

▶ Play video
high tartan
torn marlin
high tartan
#

how could I achieve those item labels seen in the picture with camera?

#

seems like it would be a headache to keep them in the correct place

#

camera completely fucks it, it all renders in the middle and is super super tiny

#

not sure why

#

OH i got it working with world space, my scales were messed on the parent object

#

now to tackle the UI haha

#

nevermind, in build it still looks bad for some reason :(

high tartan
#

i believe its an issue with 1440p

shadow reef
#

hey guys, does anyone know what's happening with this font? at small scaled it looks "blurry" almost?

#

I turned up the padding a bunch in the generation and now its a good bit better... but will this ruin preformance/create a significant preformance drop for people?

high tartan
high tartan
#

im thinking about going down the route of whenever the transform.position is changed to round it to the nearest pixel, but that seems tedious

#

atleast for the ui

torn marlin
#

I'm not sure what is going wrong with your specific case, there's a LOT that can go wrong with it.

high tartan
#

I believe I got the world space canvas working mostly correctly, however on 1440p things are still wonky, not sure why. Now i'm trying to also have my UI menu (seperate of the game world) obey a pixel grid but using camera space makes any movement super flickery (things are snapping to sub pixels, distortion,etc) when using upscaling

#

also the raycast thing is another issue that you mentioned, still unsure how to fix that

#

so a fix would to just override and transform change to snap to pixel instead to fake the effect

high tartan
torn marlin
#

Use Gifcam to make a gif of what's going wrong, and post it.

high tartan
high tartan
#

here are my settings

#

there are subcanvases that are all 1920x1080 and inherit from main

torn marlin
#

Go into one of your images and let me see what it's set to.

#

Try clicking uhh

#

I think it's called "Set Native Size"

#

Likewise, for the box sprites, you need to set their pixel units to something like... I think 0.16?

#

Okay, tell you what

#

give me like

#

a hot second

#

Do you have time to watch me stream?

#

I can meet you in a DM call and show you my project and help you out

high tartan
#

yeah that would be helpful if its no problem

#

here is what i use for most of my ui

#

is the pixels per unit multiplier the issue?

#

should it be 0.16 or 1/16?

torn marlin
#

Yeah, I've got my own project open, so I can show you how I set mine up, if you want to get in a call with me so I can share my screen

mossy tendon
#

Need some advice understanding how to implement something
I currently have it so the player could move through a menu options using the arrow keys
How could I have it so the scroll view moves to show where player is currently selecting an item inside of it?

low pike
#

increase the size of the selected nub and/ or change the colour

mossy tendon
#

No I'm not talking about showing what the player is currently selecting
I'm asking how to move the scrollview to shows what the player currently selecting
Like if there was a 4th slider not shown and the player moves to it using the arrow keys how to do I have the scrollview move to show it?

low pike
#

Oh, I missed that.

Check if the selected thing is visible somehow, and if not move the scroll view manually

devout sphinx
#

Heyo, while boxing out the UI, i'm wanting to make some gradient background panels that are a bit cleaner than using a soft circle that hangs off the edge
Would it be bad to make a 1px thin gradient image and tile that to make gradient borders?

#

I dont see any built in ways to do a simple gradient effect

abstract fable
#

Why are there boxes around the text

#

It seems to be when its out of camera view??

#

anyways how do I get rid of it

#

oh wait i fixed it

#

,_,

#

random clicking ftw

sullen scaffold
#

when i change my canvas to worlds space in unity 2D everything dissapears and i cant do anything to make it reapper without change it to screen overlay

mortal robin
#

world space objects have to be in view of the camera to be visible

thin canyon
#

I've got a TMP_InputField and it doesn't want to be focused on.
I searched around and found that

inputField.Select();
inputField.ActivateInputField();

should focus it, but nothing happens.

#

I've made one from Unity's dropdown menu without fiddling with any of the settings, yet the same thing happens.

#

I also know for sure that these commands are being run on the input field itself - but nothing is happening with it.

thin canyon
#

I fixed it by just adding an EventSystem because it didn't exist. I must've removed it. Damn.

#

Anyways, new question. This one is more fun:

I've got an image attached to a TMP_Text element.
The material is an Unlit HDR color shader, with nothing else. In the scene view - looking at the UI it looks good. In the game view it for some reason becomes a different color and completely hides the text. Any ideas?

#

This happens regardless of the material I choose. It's the same shade of red.

#

The image is behind the text and does therefore not occlude it too.

#

My guess is that the format for a material on an Image UI element should somehow be different than a normal material?
I can't find anything relating to this though...

vapid edge
#

Also I'd recommend having the image as a separate child object, which will help you avoid issues like the image covering up the text

thin canyon
#

I tried with different shaders.

#

I did a normal material shader (unlit)

#

also a sprite shader

#

same result

#

I found that the image blocks the text

#

something is making the image render on top of the text

vapid edge
thin canyon
#

aha, I see

vapid edge
#

also try using a UI shader rather than a HDRP one

#

that might help with the weird color in game view thing

thin canyon
#

that's a UI shader no?

#

the shader currently attached is a sprite shader.

vapid edge
thin canyon
#

using ShaderGraph, myself

#

left everything on defaults though.

vapid edge
thin canyon
#

huh...

vapid edge
#

but the color seems to work fine

vapid edge
# thin canyon

question: in the image component, do you have a color set

vapid edge
thin canyon
#

it's white.

#

nah

#

did you make it Unlit Sprite?

vapid edge
vapid edge
thin canyon
#

to canvas?

#

what do you mean?

vapid edge
#

instead of unlit sprite

vapid edge
thin canyon
#

I don't even have that option :D

#

I'm on 2022.3.43f1

vapid edge
thin canyon
#

URP

vapid edge
#

huh

vapid edge
#

how do you achieve the glow around it?

#

maybe the problem's somewhere in there

thin canyon
#

made a new scene, seems to work there I think...

#

I made a MainTex for it too, just too see if it needed some dependency

#

okay color has been randomly fixed

vapid edge
thin canyon
#

now it's only forcing it to stay behind the text.

#

The thing is, I want it to match the text. Is the only way to write a script for this?

vapid edge
vapid edge
#

you can make the text match the image, and modify the image to modify the text

thin canyon
#

wait lemme see. I've got some stuff that needs the text to be on top I think

#

yeah, the scaling is based on the size of the text

#

I can't have an image as the parent of the text, as the scaling is hierarchical

#

I'll make a script that matches the scaling of the text while not being a child. I think that'll work.

vapid edge
#

why don't you make one prefab, and then parent both the image and the text to it

#

and make them fill the entire thing

#

and just change that empty parent when you want to change both

#

I think you might be doing something weird can you explain why you're doing what you're doing, this doesn't make sense at all to me

thin canyon
#

yeah both things work actually.

thin canyon
#

though I'm not sure if your solution works in this specific case, as I need the text to scale the parent object.

vapid edge
#

why don't you scale the parent object then, and let the text scale up to it?

thin canyon
#

because of this. It's scaling with the text. Some text is longer, some is shorter.

#

there's really only workaround-solutions to this :P

#

I need the object to be scaled to whatever the text is, so yeah I could scale the parent-object to the scale of the text-object, and that's almost the same as the wacky background script.

#

just scaling a different object :D

vapid edge
#

ohhhh I get what you're doing!

vapid edge
#

ahh, text is multi-line?

thin canyon
#

depending on what resolution you're on the text might wrap around. This makes the size bigger...

vapid edge
# thin canyon

I'm still thinking, but yea I think what I'd do is set content size fitter on the text, then indeed just make the preferred width and height (in layout element) of the parent element to be what the text is

#

I remember doing exactly that in another project

#

legitimately almost made me write a tool to make this less of a pain in the ass

#

didn't end up doing it sadly

vapid edge
#

let me check how I solved this

#

there's a way to force a repaint

#

relayout I mean

#

_layoutGroup.CalculateLayoutInputHorizontal();
_layoutGroup.SetLayoutHorizontal();

#

in my case it was horisontal in your it'd be vertical

#

ah no, you have control child size enabled

#

nevermind

#

that's how I did it in my project, and I just changed the child size from code

high walrus
#

i try to explain this as detail as i can

#

i ran into a problem now

#
element 1                      element 2
element 2   if u delete 1      element 3
element 3         ->           element 4
element 4                      element 5
element 5```
#

this is normally what ur view will be if u do that to a UI with many rows

#

is there anyway to lock the UI arrangement?

#

like making the UI look like this in view

element 1                      
element 2   if u delete 1      element 2
element 3         ->           element 3
element 4                      element 4
element 5                      element 5```
#

supress the auto arranging ability

indigo jolt
#

Hey guys I was trying to build my UI and wanted to have the head animated next to the health and mana bar. I used image to build and then was gonna use a sprite render and try to sync states with the head (So if a character is stunned downed etc it would show next to health bar too). When I switched from image to sprite render it no longer shows up in game screen.

winter jetty
#

Yo! I'm having some trouble with layout groups and its really stumping me. Whenever i add something to Preview Toolbar's horizontal layout group, the group changes size and even pushes other layout groups around. I have NO idea what could be causing this, since theres absolutely no padding on any of the layout groups. does anyone know what's going on?

#

please ping me if someone responds!!

honest saffron
winter jetty
#

from my knowledge, that should expand the children (the white squares) to the height of the toolbar

#

but that shouldn't change the toolbar's height itself

honest saffron
honest saffron
#

the 2nd option sounds better, i cant think of any problems that solution might have rn

winter jetty
winter jetty
#

I figured out how to fix it (i put the layout group in its own gamepbject thats a child of the toolbar), but i’m still having trouble getting it to where i want. Here’s a diagram of my idea; is this even possible?

pseudo wave
#

hey i have the following Problem:
i created the ui as u see in picture 1 but on the camera the assets i inserted arent shown.
What did i do wrong? thx for any help

mortal robin
pseudo wave
#

ah so drag and drop doesnt work i have to create a UI Objekt like an Image first and then select the Asset as Source Image right?

potent patio
#

I put a new button inside the handle. When I click the button and pull the horizontal joystick, the handle does not return to the center. When I do not click the button and pull it, the handle returns to the center point. I want the handle to return to the center when I press the button.

lapis crest
#

hello,

what exactly is the name of this icon style? as far as I know it is “grunge” but there are very few images under the name “grunge”.

spice grotto
lapis crest
#

I think it has a name of its own because its an art style that appears in so many games.

kindred slate
#

Hi. I have a very simple problem but cannit find any solution yet.

#

I just want to Flash/change color of a textmeshpro UI text that have a vertical Gradient on it.

#

Anybody know how to do it?

#

I mean fade to another color/gradient.

high tartan
#

is there a way to get sliced/tiled to be pixel perfect?

#

like only scale to pixel perfect amounts?

#

also, how can i fix this jitter?

celest garden
#

I tried switching to TMPro from legacy text, but outline on font looks really bad compared to Legacy text, is there any way to fix it?

high tartan
earnest wharf
#

why is my UI not perfect even with pixel perfect on???

torn marlin
#

Does the sprite "boil" when you move it around?

#

I.E, does the sprite warp or does it stay exactly the same when you move it from left to right?

#

Unrelated, but I can't believe nobody talks about how RectMask2D doesn't break UI batching.

honest saffron
bright dagger
#

what kind of UI element should I be using for a selection list? where selecting one element deselects all others?

oblique sonnet
#

Is there a way I can mask this UI progress bar taking into account the cutout on the graphic beneath?

hollow hearth
#

Hey I have 2 designs for an inventory but I dont know which looks better waht do yall think?

mortal robin
mortal robin
dark night
#

dumb question maybe, but is there a way to make a TMP RectTransform somehow auto-size down to a managable size relative to its parents mesh? i am so tired of having to resize them down from being way too huge

low pike
dark night
#

@low pike Does this 100% of the time for me, always has.. before/after adding a TMP as child of the cube. (via right click -> 3d object -> Text - TextMeshPro

low pike
#

Oh, you mean 3d TMP, not UI (this is a UI channel.. subtle difference).

I've rarely used the mesh version, not aware of a way to auto scale it

dark night
#

oh my bad

low pike
#

Assuming Unity doesn't have a built-in way.. maybe make a prefab of a scaled TMP object

#

and use that

#

I'd unpack the prefab after adding it to the scene each time

dark night
#

yeah, honestly i should, just keep putting it off. it's just crazy to me they have TMP in the 3D menu yet it has no ability to come close to sizing itself in a convenient way

low pike
#

sizing itself to ... what

#

It can't know what scale you'd want it at

honest saffron
#

just change the font size

dark night
#

relative to the mesh of a parent. but maybe that's somehow difficult to do hence why its not implemented

#

Font size alone doesnt help, the width and height of the TMP Rect is also way too large

honest saffron
low pike
#

relative to the mesh of a parent... is still dependent on what the dev wants. You may want it tiny so 'next text' fits nicely along the bottom of the cube, I may want N to be the size of a cube face

low pike
dark night
#

You cannot remove the Rect

honest saffron
low pike
#

Don't even know why it has a RectTransform for the 3d one

dark night
#

I know right?

low pike
#

Makes sense for dynamic text that'll change during gameplay, so you don't have to add /n everywhere

dark night
#

guess that doesnt really illustrate well without scale context but yeah

honest saffron
dark night
#

Yup that does the trick

low pike
# dark night

Just press R and drag the middle cube to resize all 3 axis at the same time?

low pike
#

Does a content size fitter work on it? 🤔

scarlet ether
#

Hey guys on photoshop my image look like this .. without the white border.. on uniuty it has a white border.. any ideas?

scarlet ether
#

Tried all options possible and cant fix. Also image in photoshop is darker

austere ibex
#

im having issues making ui for the first time, the edges of my boxes are very jagged inside unity. does anyone know how i can fix this?

honest saffron
cobalt badger
#

is it possible to get a UI to have this look in a 2d URP?
I want to give the UI a "3d perspective look", however, the game is 2d.

ionic beacon
#

Make a separate 3D camera and use it to render the UI in world space

cobalt badger
#

OK so no need to choose a 3d unity at project start?

azure flame
#

It's only for initial settings.

proud kite
#

hey everyone! i just opened up a new project and when i inserted a tmp text and set its color to match an assets color, it displayed a lighter one than what i set. i checked its settings and the rgb code was correct. i didnt really change any global settings or anything and this is a fresh install of unity. could somebody help me out? thank you very much!

azure flame
#

Your text element or font asset itself could have additional tint applied.

proud kite
#

the default font, liberationsans has this same effect too

proud kite
#

thank you very much! it is fixed now

vocal notch
#

hello hello

#

I want to ask if there is a way to stop my menus form stacking from one other, I kinda want the previous one to disable whenever I like another pop menu

abstract fable
#

When I export to Itch.io, the video players in my scene disappear...

#

this is the itch page

#

all those video players masked out by the png disappear

mortal robin
# abstract fable

It's really hard to tell what we're looking at in these screenshots

mild dome
#

how can i make the jeans object height match the cells?

#

i need the yellow line to be always the same as the red line

#

height wise

#

at the moment i have to scale it manually to match it

#

is there a way to do it automatically

signal steppe
#

does anyone kknow how i can make smooth buttons like the phot on the right, when i attempt it on unity the sides are blurry, i just want to make rounded buttons

modern owl
#

you are using very low quality resolution images, go to the package manager and install 2D Sprite package from unity registry, then on your buttons image component set the sprite to the 9-sliced sprite, now you can set the image type to sliced and modify the pixels per unit multi to get the rounding amount you want.

signal steppe
modern owl
#

Sorry for late reply.

cloud lintel
#

Does anyone know what Unity Hub is using for it's UI framework?

ionic beacon
#

It's an Electron app. Probably just custom CSS.

ornate hemlock
#

hi! besides the placeholder UI, do you think the rest of the things match with the game graphics? the portal in the middle and the bottom bar

scarlet ether
#

Hey guys I moved an UI Image, but the anchor points never follows it.. is there a way to move the UI Image and the anchor points follow it? Like here?

azure flame
#

You need to clarify how you are moving it, is it with code or you just dragging it.

#

and provide more information in general, what's the desired effect?

scarlet ether
steel cairn
#

How do I make it so that this smaller square scales whenever the parent square scales

#

when I scale it to be bigger this happens

#

When I scale it to be smaller this happens

azure flame
# scarlet ether Just moving it.. You can see I drag the UI Image but the 4 anchor points stay th...

Still didn't say what you want to achieve. UI driven by anchors, when you drag something you are creating relative offset. Take a look at the tutorial https://learn.unity.com/tutorial/manage-screen-size-and-anchors?uv=6&projectId=61b9fc0fedbc2a24a5bbc5a2#

Unity Learn

You can spend a ton of time making your UI look perfect on your screen, but what happens if someone opens your application on a screen with a different size or a different shape? In this tutorial, you’ll learn how to consider the screen’s aspect ratio and use Canvas Anchors to make sure your UI elements stay where you want them to. By the end o...

azure flame
#

If you want it to sit in a specific place proportionally, set child anchors accordingly

steel cairn
#

oh my god fog sight

steel cairn
#

I can't tell you how long this issue has been affecting my app

#

I'm nearly 3 months into development and I've just been doing work arounds to make almost fixes that have been limiting what I can really do

#

I was literally on my way to fiverr to pay somebody to tutor me on this lol

azure flame
#

Unity Learn has plenty of tutorials on UI for free

steel cairn
#

Where di d you link it?

#

Honestly I'm probably like 50% of the way there with my app at this point but I really gotta say I'm super grateful

azure flame
#

Sometimes you also have to take time and experiment with system you are working with. Manual can also explain a lot about UI

steel cairn
#

But I just couldn't figure this thing out

#

I've done a lot with the UI tools at this point with good success with it, but this just escaped me

#

I can't tell you how long I worked on this, 1000x thanks

scarlet ether
azure flame
scarlet ether
#

I just imagine that there is noway to achieve what I want based on the link your provided and all the research I have done. Thank you for the help tho.

azure flame
#

Also anchor points are.. anchors, they are there to provide base orientation. If you want to reset anchors click on stretch mode

scarlet ether
#

I want them to follow the image I moved on the video above and not stay in the same position they were

#

So I dont need to reposition them again.. and they will just follow the image I am dragging

#

I imagine its not possible to do it I guess

steel cairn
#

Actually, I have one more question @azure flame

#

How would you do this anchor adjustment for objects in a layout group like this

#

wait, nevermind maybe

#

Yeah nevermind

#

Thanks fogsight

#

I don't have time to actually change my main app tonight but I'm confident I can solve one of the biggest long standing issues I've been dealing with. Again, thanks a ton man

azure flame
azure flame
azure flame
steel cairn
scarlet ether
scarlet ether
#

Do I need to download something?

azure flame
#

I think this one required Editor folder, folder itself can be anywhere.

scarlet ether
#

Just a folder with name Editor?

azure flame
#

yes

scarlet ether
azure flame
#

Doesn't seem to require Editor even, works as is perfectly.

scarlet ether
#

For you its working?

azure flame
#

it looks like it is using visual scripting package, you need it for that

scarlet ether
#

So in package manager? I tried to find there and couldnt find it

azure flame
#

install package by name com.unity.visualscripting

scarlet ether
#

Cant find it even on the website to download it.. did u find it there?

#

Also its saying that is already installed by default.

#

From Unity Editor version 2021.1 onward, Visual Scripting is installed by default as a package.

#

So I should have it but when I go to the edit and project settings its not there the options.. hmmm

azure flame
#

It seems used only to enable getting RectTransform from context object which otherwise doesn't have it.

scarlet ether
#

your package manager looks dif than mine

#

Mine doesnt hav eit

#

doesnt exist anywhere and also cant find to download.. 😟

#

everywhere that I see seems that I should hav eit already but for some reason its not there

#

Ok I used ChatGPT and now its working without the visual studio @azure flame Thank you

azure flame
#

@scarlet ether Change these lines and remove Visual scripting.

        var rt = (RectTransform)command.context;
        var rtParent = (command.context as RectTransform).parent.GetComponent<RectTransform>();```
scarlet ether
#

Already did, used chatgpt and it fixed for me.

azure flame
#

context is already RectTransform it was unnecessary to get component out of it

scarlet ether
#

that worked for me

#

You dont know how much this will save my life I have been suffering so much hahahah

#

THANK YOU !!!!!!!

azure flame
#

I should look it over later to see what else I can optimize there.

scarlet ether
#

Now this will save me hours

#

I have been suffering

#

hahahaha

#

Best would be creating a hotkey for that if possible

#

than would be GOD

azure flame
#

language model didn't fix other mediocre choices in that code

#

You should not use things it generates as is

scarlet ether
#

I tried to make in a way to use a hotkey.. it shows the hotkey ther but doesnt work

azure flame
#

Did you select the component at the time?

#

it needs context

scarlet ether
#

I selected just the object in the hierarchy

#

Even tho clicking on the component it doesnt work.

#

its blue as it is selected

#

Anyways its amazing already I have like 1000 images on my game and I had to do all manually so far.. I wish I had asked that before.

fluid helm
#

How to make the text overlay the object?

sharp belfry
#

Any repository of hot UIUX tips someone could recommend?

sharp belfry
scarlet ether
#

hey guys why my text mesh pro looks like this and never shows the text?

vocal notch
#

Does anyone knows a way to stop the menus to stop stacking on one another cuz mine stacks which covers the previously open rather than disappearing

wild pebble
vocal notch
#

like menu 1 is open then you click menu 5 without closing menu 1 menu 5 covers menu 1 instead of menu 1 closing

#

its not so obvious but I don't wanna risk getting found out later this is my only problem left sigh~

#

also if you open menu 5 without closing it and wanna see menu 1 you won't be able to see it cuz by some reason menu 5 covers the entire thing so menu 1-4 is covers by menu 5 unless you close it

wild pebble
#

Nothing will happen automatically, you must make sure the open menu is closed when you open a new one

vocal notch
#

nvm I solved it

#

I'm finally at peace thanks anyway

vocal notch
sturdy forge
#

I'm not sure what channel this question belongs in but I am having an issue where my UI Images don't seem to be centered, no matter what I do...

If you look at the images I have attached, you will notice that the smaller image that is just a copy of the larger one with darker color doesn't fill the larger one completely straight. The surrounding "frame" is somewhat thicker on the right side.

If I try to move the smaller darker image to the right, I get to 0,3 and there is not difference to 0,0 whatsoever, as you can see in the images. It is still skewed in the exact same way. Then once it gets to 0,4 it flips over and is more skewed towards the other side. So no matter how I position the image, it's always skewed towards one side.

I've also tried inverting the image by setting X-scale to -1 instead of 1 just to confirm that it's not the image itself that is crooked but that didn't change anything at all. As you can see in the final image, I also tried with a basic stock image of a circle and the exact same problem persists.

I have tried several different ways of anchoring the image and I've tried using a layout group to position the child in the middle center but the images never seem to be entirely centered on each other.

What could be the cause of this?

#

Never mind, I seem to have fixed it by just enabling "Use Sprite Mesh" on the Image-component... "Preserve Aspect" doesn't seem to affect anything but this sprite mesh did solve it entirely...

fluid helm
gloomy marten
#

IMO, that yellow bar should be in the left corner as currently it looks awkward

nimble palm
#

Hey there, anyone know why my custom cursor is 4x bigger than the default one?

mortal robin
nimble palm
nimble palm
#

Ok, when I change the cursor size on windows, it affects the cursor on unity, but in unity is always bigger than on windows

serene sparrow
#

I have a Content Size Fitter on an Image, and a Content Size Fitter on a Text that is a child of it.
The image is a frame and so I need the Image height to be the height of the Text + some padding. How do I get that padding to work? RIght now it's forcing the Image to have the same height as the Text, so the text is overlapping the frame's edges

serene sparrow
#

Found the solution. The frame image also needs a vertical layout group with the padding

untold plover
#

Is it possible to force unity to build the game in a certain aspect ratio?

I want to build the game in 16:9, but it keeps becoming 16:10 in the final build.

Attached are my settings -- is there anywhere else I need to change things?

Thank you!

untold plover
#

Nvm -- I had to delete my build instead of replacing it -- it looks like that ended up fixing it!

cloud lintel
#

It seems to be built on top of UI Toolkit

proud sandal
sacred matrix
#

Does anybody know how to get my text to show on my game view?

frosty pewter
frank cave
#

how do I hide the backside of text/images? I have these on a canvas that exists in world space, but I dont want them visible from behind

cedar spindle
#

I have a horizontal layout group that doesnt controll the childs size. When I instancite elements into that it doesnt want to update, I have tried forcing with forcerebuild and tried disable and enable but it doesnt really work. Anyone faced anything similar?

cedar spindle
#

I have a solution now with a ienumerator that has a while loop with force update while the entire animation plays and then a action that stops it when animation is done, doesnt feel very elegant but it kind of works

flint stratus
#

Why does Unity's Editor keep turning on Normal and Tangent shaders for my canvases even when I manually turn them off? For that matter, if it knows they don't work for Screen Space Overlay, why does the Inspector even turn them on in the first place?

sacred matrix
frosty pewter
#

so you understand where it actually is

sacred matrix
#

Nevermind I got it thanks for the help 👍

granite grotto
#

Are there any plans to control font size on Editor for Linux and Mac?

tranquil field
#

HI folks... I have a vertical scrollview. I want to know how to make content children adaptive to screen resolutions. Thanks in advance 🙂

wind rock
#

I am adding localization, the chinese font gets squares around it when viewed from further away (in game too)

#

Anyone know how to fix this?

honest saffron
# wind rock Anyone know how to fix this?

Usually this issue happens when you have an incorrect ratio of Sampling Point Size to Padding. Try keeping that around 10%.
(also it takes 5 seconds to google why your textmeshpro has squares around it)

wind rock
pure pier
#

hello, im using TextMeshPro buttons and they just won't click or activate
hover styles don't do anything either
i believe with this current config it should work.

#

nothing at ALL clicks or does anything even with linked actions

tribal belfry
#

Hi, Is anyone having a problem with TexmeshPro Input in Unity 6? When I type text, my screen changes to look like an ipad screen, causing the layout to break.

honest saffron
#

(the Background gameobject)

#

because for the ui, the hierarchy order decides whats on top of eachother

mortal robin
tribal belfry
#

I think it has problem in: unity 6 new input system UI input module

pure pier
honest saffron
pure pier
#

I’m not sure if world objects can do that

#

There’s only buttons

#

do I have to set the Z level?

honest saffron
pure pier
honest saffron
pure pier
#

-# properties are same on each canvas

honest saffron
pure pier
#

oops

#

wrong image

#

i placed the whole everything UI related onto the top of the hierarchy and that fixed it

#

as in, on top of everything in the explorer

honest saffron
pure pier
#

no, because i moved everything UI related to the top

#

anything UI is under that UIManager object

honest saffron
pure pier
#

there arent

#

everything else is a world object

wind rock
#

If you have experience with the game object localizer, please check out this post.

frank cave
#

whats the issue with this?

#

why wont it colour the material the base colour?

mortal robin
frank cave
#

also I created it Shader Graph > URP > Unlit Shader Graph

burnt shard
#

hi I had a question related to the UI system so I have an puzzle system wheres its an Image that will have rotating ring that you gotta rotate to make the image such as the first image.

and I want to group them so I can scale them and scale them down but the problem it does this :
when I resize it or scale it up
thats the structure so far and their pivot.

is there something I am doing wrong? how would I make that the sprite resize with its parent uniformly?

dusk vapor
#

Hey, I want to scale these bars down vertically and move the icons to the left so I can get rid of the text, but I don't know how I would do that since my background is black, I don't think changing the icon's colors would look very nice, does anyone have an idea of how I might do this?

subtle pilot
burnt shard
scarlet ether
#

Hi guys, question. .When I have a button and I set a color to change when the button is highlighted.. It works.. but if I click on the button the highlighting stops to work.. any tips?

scarlet ether
tight parcel
#

What is the best solution for UI currently ?

  • Old canvas way
  • UI Toolkit ?

A lot of new Unity tutorials didnt use UI Toolkit and i think some things are missing on it

Do i need to use canvas and Switch to UI Toolkit when its ready ?

modern owl
#

Unity UI, it isn't "OLD", its the production ready way at the moment

#

for game play/realtime UI

#

UI Toolkit is better for In Editor UI

#

Than GUI

tight parcel
#

So for ingame ui, you recommend to use canvas instead of UITK ?

modern owl
#

Yes.

trail laurel
#

any idea why my item ui prefab changes rect values when i parent it via code

#

i want the values (left/top/right/bottom) to remain 0. but when parented they changes to this

mortal robin
#

Instantiate(prefab, parent)

#

That works best

#

Instead of parenting it after

trail laurel
#

oh ty, didnt know u could do that

trail laurel
mortal robin
#

What I said will fix it generally, but it's hard to say without seeing your code etc

trail laurel
#

nvm that fixed it somehow ty again

halcyon basin
#

Hey, how do you properly sort VFX particles against the UI canvas system?

I'm trying to understand the "correct" setup. its a 2d mobile game. I want to have my VFX render above the board, but below any menus that would open. I want to make sure the VFX image/camera rescales to the overlay if the dimensions were to change.

I've tried multiple cameras but that appears to be expensive. The issue is also what camera settings to use, so that it keeps proportion with the screenspace overlay canvas's dimensions. It says overlay auto scales so that's a problem that could cause scale parallax (ex. vfx camera scale is out of sync with overlay, and therefore creates parallax)

Maybe the question is "how do you make a camera scale to the screen space overlay's dimensions dynamically" while being performant? Ideally without an update loop, since it would just scale once on Start/Awake to the mobile phone dimensions

Any suggestions on approach?

quaint karma
#

Why does my UI not show up if I have a camera with a target texture. All the UI is on a canvas and it only shows up if I manually click it on and off while in game.. Really strange

scarlet ether
#

Hi guys.. if I scale the size of the game window.. everything scales as it should.. and stays in place. but the UI text always maintain the same size.. any ideas how to fix that?

rapid ferry
#

Unity 6 made a new canvas, why does all elements look like this but fine in game view?

#

derp sorry was in wireframe view

wind rock
#

Can somebody with localization experience please help me with this?

wind rock
#

Sorry forgot link

cinder inlet
#

Hi everyone, 🙂

I'm at a stage in the development of my game when I'm considering what UI solution to use.
I cannot find recent state-of-art of UI in Unity so I'll recap them there trying to get anyone's attention to enlighten me on the experience you had with any of these solutions!

Built-in solutions

  • UGUI
    We all know how to use it, legacy UI system, game-object based, production-proven, etc. I enjoyed using it but there are many aspects that I feel bad about using it nowadays. The usage of prefabs for templates is a mess when interfaces start getting complex. Updating colors/themes/variables through several of them is not convenient either. In addition to that, and unfortunately (or not), its deprecation has already started with the introduction of UI Toolkit, which claims proposing better performance, architecture, and support, so I don't feel like starting a fresh project using a soon outdated system right now.
  • UI Toolkit
    Announced as the replacement to previous UGUI, I was excited starting using it to convert my Figma template into the engine. Once used to the very basic layout logic from the web, using UI Toolkit is game-changing for quick iteration, it doesn't bloat scene hierarchy, styling and behavior are truly isolated from structural definition. However, my disappointment came sooner than I expected. I searched for basic shadow effects which I consider inevitable when designing interfaces and I couldn't find any support about it as to my great surprise they are not implemented. So, my concerns are about its limited features, including missing blur, shadows (most annoying one) or custom shaders, which sadly make interfaces look pretty much visually poor.
#

Third-party solutions

  • NovaUI
    I've read through NovaUI page and consider it as a potentially strong candidate for replacement of previous built-ins solutions suffering from being either inadequate/soon-unsupported or too-early/incomplete. NovaUI is still game-object based (as UGUI) and provides a wide range of features. Its free version is very permissive as it only misses Burst optimization compared to paid version (which is only 55€ where I live). I'm wondering "why not" but lacks of any thoughtful feedback.
  • Rive
    I've watched a talk from the CEO of this solution and found it very neat. It provides a totally external desktop client to use the same way you would do with After Effects/Illustrator. Then, your project can be imported to Unity and rendered onto a Unity render texture. It looks very promising, powerful and performance-friendly. On August 13, they removed the limit on files for the free tier. I'm not aware of missing game-changing features in free-tier except audio and custom fonts (there is Google Fonts accessible though, might do the job if you don't need very specific fonts). This solution is subscription-based and pretty expensive if you're not a solo dev (32$/seat/month)...
  • ReactUnity
    Open-source, runs a React renderer within Unity. It is lacking great documentation and might have a performance overhead, but still a plausible alternative if needed. Colossal Order used a similar approach for Cities Skylines 2 (according to their latest talk at Unite). I'm not sure if it really worked for them though.
#

It might be better I open a discussion for this kind of topic 😄

tight parcel
cinder inlet
tight parcel
mint ravine
#

hello
someone have any idea why all text in my game randomly changed on green?

#

I was just changing some cursor settings

#

its setted to white

#

any code changes

#

uhhh
I just found it

#

idk how

#

i sware i dont changed that

zenith stream
#

Hi, I have the problem that, while importing a .png as a sprite (2d and UI) my icon gets scaled in a way it looks really bad while even windows explorer (Icon above) displays the image correct. How can i fix that?

honest saffron
#

looks like it should be a small button

zenith stream
#

yes in this case definitively, but I have the same problem with all of my icons (all of them are 800x800), some of them are used in cases where it is required to display them bigger. Is there a way to configure the sprite properly, so the scaling works fine (like it does in windows explorer)?

#

Well, I just scaled it down, looks way better now. Thanks!

honest saffron
#

mipmaps maybe?

#

or just make different sized images

verbal stag
#

Hey everyone, quick question. I want to change the size of my text field to accomodate for the text box portrait ONLY when the portrait is active. Is there a way to do this with the UI content fitters, layout groups, and such?

worn kayak
#

In a local coop/couch roguelike where players have to choose between 3 upgrades on each levelup, how do you incorporate that for 4 players?
I was thinking of partitioning the screen into 4 quadrants, one for each player and showing the 3 upgrades for each player in their quadrant, but it might be too small. How would you design it?

mortal robin
#

A little UI that pops up above the player's head is one option

#

or you pause the whole game and let the one player choose a thing

worn kayak
mortal robin
#

Sure that's one option

#

Might not be very efficient

#

might be annoying

#

if they all level together, pausing the game and splitting into quadrants makes sense to me

vernal rock
#

Anyone have ideas on how I could achieve this sort of blur effect?

somber badge
#

Hi! I was implementing a minimap into my game and I've got it working well. I want to make it so that instead of the icons abuptly cutting off at the edges of the minimap it instead slowly fades way. I was wondering how I could achieve this effect?

lavish garden
#

wondering if there's a way to make a slider that slides on an arc instead of linearly?

#

after some searching it looks like there's no hard and fast way to do that with unity ui components, just have to manually set the position

mortal robin
#

Looks more like rotation than setting a position

scarlet ether
scarlet ether
cinder inlet
stone pollen
#

Why do the red tridents start to glitch like this, if I increase the spawning count of this prefab?

#

And this is the Inspector perspective of tis Sprite:

#

This "glitch" is only visible through the camera.
The Scene View doesn't have this issue what let me guess that its maybe a Graphic Quality setting, that is blocking those full sprites, if there are to many at the same time...

But what graphic setting exactly, in case if I am not wrong?...

mortal robin
stone pollen
mortal robin
#

how does it look when you're zoomed out

stone pollen
#

those part in the yellow circle would look a bit more like balls instead triangles.

But anyway, I guess I found the issue.
And it was a combination of the default 16:9 Landscape resolution and the "pixels per unit" scale of the sprite.

#

Thank you anyway.

wind rock
#

How do I change the current active locale via c#?

worn kayak
#

Has anyone faced any issues with UI freezing the editor when upgrading from 2022 to unity6? Even when editing a prefab of a canvas with elements inside, the editor just hangs. Checked all logs and theyre empty. I noticed its mostly from Grid/Horizontal group layouts..

mossy tendon
#

Not sure if this would be best to ask in here or #🏃┃animation
For buttons if have the transition set to animation, how to do you have it so the timing is the same as if it was set to color tint?

#

The default for animation transition seems slightly slower

#

Is the best way to do that to just adjust the animation speed in the animator?

#

Nvm I see
Just needed to adjust the transition times

tight parcel
# vernal rock Anyone have ideas on how I could achieve this sort of blur effect?

Try to create a custom shader for your button in the canvas and follow the tutorial:
https://www.youtube.com/watch?v=rSYXieJadIA

Im pretty sure the same code can works for your use case

Zii

50% off new release discounts on the Asset Store: https://prf.hn/l/dlR3glw

  • It's a tradition by now, I have to find every way possible to make blur in Unity. This time it's in HDRP used as a UI background and I'm using the custom pass feature with a very simple shader made in shadergraph that I discovered by accident.
  • Made in Unity Editor 20...
▶ Play video
somber badge
#

Hi! I was implementing a minimap into my game and I've got it working well. I want to make it so that instead of the icons abuptly cutting off at the edges of the minimap it instead slowly fades way. I was wondering how I could achieve this effect?

wind rock
#

Getting an error with localization functionality. If you have experience with Localization, please check it out.

#

I hate unity built in localization holy shit

#

This is the buggiest stupidest feature I ever worked with

scarlet abyss
ocean parcel
#

Help, I can't set a UI image's source even though I did set the image asset as a sprite.
Did something change with Unity 6 ?

low pike
#

!ask

onyx flowerBOT
low pike
#

nothing changed with Unity 6

trail trail
#

Is there any easy way to fix this? It happens on rotated assets.

#

(Note: This isn't zoomed in. Any UI Asset that is slightly rotated, no mater the size, has this.)

#

Large scale screenshot in an example scene with just a camera and a white box asset for example. (1920x1080) AA enabled in URP and on Camera.

mortal robin
trail trail
mortal robin
#

Which kind of AA

trail trail
mortal robin
#

idk - antialiasing should fix this issue and that's the limit of my knowledge

trail trail
#

I agree with that statement.

If you toss a white box onto a canvas, and rotate it 5 degrees, you should see the same effect.

mortal robin
#

Is this an overlay UI?

#

If it's overlay then the settings on the camera aren't going to help

trail trail
#

Cheers.

#

Simple fix will to be just have a Canvas Camera with its order set to highest I assume.

trail trail
ocean parcel
#

What would be the most efficient way of making a bar like this ? (similar to sekiro's posture bar)
If I simply use a mask and scale it, the filling of the bar would just get squashed along with the mask until there are no corners visible.

wind rock
#

I am so fucking done with the official localizaiton system

#

Can anybody recommend a better one, maybe from the asset store, which I could use?

trail trail
# wind rock I am so fucking done with the official localizaiton system

Theres an official localization system? Must be new since the last time I used it.

In the past, I kinda just ended up writing my own based on a system I used back in like.. Unity 4?

Basically it just grabbed a Excel/Google Docs spread sheet and just grabbed the locatization from there. So when developing I'd have placeholder text, with a script that said "Go grab KEY_MAINMENU_STARTRUN from Spreadsheet in current selected language." then ran my own Database for images that would need to be translated (Which wasn't a lot TBF.)

#

But looking briefly at the offical locatization, it seems good. What is your problem with it?

mortal robin
#

What does "ghost objects" mean?

#

You need to give us some context as to what you're talking about

#

What does:

although in my components i cant add the ghosts
mean?

#

I want you to send any and all informtation that would make me understand what your issue is

#

You said you can't do something

#

why

#

what is stopping you?

#

On which iobject?

#

Is this an object in the scene?

#

Is this a prefab?

#

ok and the ghost objects?

#

What components are on them?

#

Ok so

#

they don't have the "Ghosts" component on them

#

that's why it's not working

#

Btw "Ghosts" is a very weird name for a component

#

in almost all cases, a component's name should be singular

#

because it represents a single instance of a thing

#

See how it says "None (Ghosts)"? It needs an object with the Ghosts component on it

#

because you made your field with the type Ghosts

#

show me

#

you named your script incorrectly

#

The name of the file needs to match the name of the class

#

public class Ghosts needs to be in a file called Ghosts.cs

#

you named your file "NewMonoBehaviourScript.cs"

#

according to this screenshot, it is not

#

otherwise this would say "Ghosts (Script)"

#

The file name is wrong

#

as I mentioned

#

or rather

#

the class name is wrong

#

one of those two

#

I think actually the class name is wrong

#

Make sure you saved it

#

Also make sure you don't have any compile errors in your console window

#

That's more likely the problem

#

this is not the unity console window

#

show the unity console window

#

you almost certainly have a duplicate script

#

(probably the one named "NewMonoBehaviourScript")

#

np

icy dome
#

Hey guys, just wondering because this was in every unity version (now on Unity 6) i tested the case:

I can deselect the additional shader channels, the next time i click on the gameobject it's again like that, incluse warning. Am i alone with it? It's just a bit annoying.

mortal robin
#

At least, that's my understanding

mortal robin
fathom harbor
#

Is anyway in Unity to create shadows for UI like in Figma or something?

scarlet ether
icy dome
somber badge
#

Would anyone know how to add a UI transparent gradient effect? I'm making a minimap that has icons for rooms/entities, no borders and no background. The set up I have right now makes it so that the rooms and icons are cut off at sharp edges due to the mask and using a square image as the mask. I was wondering, how would I make it so that the room icons and contents of the minimap becomes transparent as they reach the borders of the minimap? Should this be done through scripting or is there an easier way to achieve this through the unity editor.

winged wren
#

Hello. I have a slight problem. I have this setup in my UI:

  • Page Indication with only Rect Transform, that has 2 children:
    • Selected Page Indicator that has only Rect Transform and Image components
    • Unselected Page Indicators that has Rect Transform, Horizontal Layout Group and Content Size Fitter set to min size (for both axis). It also has 4 children that all have Rect Transforms and Image components.
      I want Page Indication object to be same size as children, like with content size fitter min size, but when I set it to min size or preferred size, it becomes 0. What should I change?
      P.S. Selected Page Indicator should be on top of Unselected Page Indicators object

Thank you for advice

rapid ferry
#

Is it possible to create curved HUD elements in Unity?

mortal robin
#

of course

#

you can import any shaped sprites you want

#

you can also use the vector graphics package to import svgs

#

You can also use postprocessing on your UI

#

Or write custom shaders to do whatever you'd like

rapid ferry
# mortal robin of course

thought about making something similar to the dragonball sparking zero HUD, seems curved, but not sure how it's done haha

rapid ferry
mortal robin
#

Possibly a custom shader or two for the bars filling with the curved shape

hollow lintel
#

unity 2022.3.30f1 why does my textmesh pro offset down a bit when i run the scene? other game objects dont offset only the text

ornate light
#

Hey everyone, looking for feedback on some UI choices for my fire emblem style game. I would appreciate it if you could fill out the survey, thanks!

https://forms.gle/qRjfeemcC3QC517J7

iron dock
#

how can i make this?

#

the fading transparency

#

it looks super simple just idk how lol

wild pebble
crimson valve
#

Having some headache with nested layout groups. Seems to just eat away at the space when i enable flexible height/width.

#

Seems like making the parent layout element to flexible high/width, priority = 0 seems to work though.

mortal robin
heavy sentinel
low pike
#

It's just a gradient. Make the image white, set the alpha to 0 on either end and export as a png

red onyx
#

This might seem simple or I'm having a brain fart, but per each character I add the Panel just decides to "add" a small margin on each side of the text?
Though in the inspector there's no margin whatsoever. I'm using textmeshpro, anyone have a clue what's up with this?

carmine trout
#

when i increase outline thickness of text mesh pro. grid starts to appear. what am i doing wrong? the font assset was created using Text Mesh Pro Font Asset Creator. render mode: SDFAA, sampling point size: auto sizing. padding: 5. packing method: fast

lilac relic
#

I'm trying to switch from hearts to a health bar in my game that can be upgraded, but I'm having problems with the "current health" bar never reaching the end of the "max health" bar when the player is at full health after the player upgrades their max health. First screenshot is unupgraded max health, second is upgraded 1 tier, third is upgraded 2 tiers, and fourth is upgraded 3 tiers. The player is at full health in all of them. HealthBarTotal is max health. The health bar script too long to send along with the rest of this message so I'll send it in a separate one.

#

Healthbar script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Healthbar : MonoBehaviour
{
    public static Healthbar Instance;
    [SerializeField] private health playerHealth;
    [SerializeField] private Image TotalHealthBar;
    [SerializeField] private Image CurrentHealthBar; 

    private float initialMaxWidth; 

    private void Start()
    {
        Instance = this;

        initialMaxWidth = TotalHealthBar.rectTransform.sizeDelta.x;

        UpdateMaxHealthUI();
    }

    private void Update()
    {
        UpdateCurrentHealthUI();
        UpdateHealthBar();
    }

    public void UpdateMaxHealthUI()
    {
        if (playerHealth != null)
        {
            float newWidth = initialMaxWidth * (playerHealth.maxHealth / playerHealth.startingMaxHealth);

            TotalHealthBar.rectTransform.sizeDelta = new Vector2(newWidth, TotalHealthBar.rectTransform.sizeDelta.y);
        }
    }

    public void UpdateCurrentHealthUI()
    {
        if (playerHealth != null)
        {
            float healthPercentage = playerHealth.currentHealth / playerHealth.maxHealth;
            CurrentHealthBar.rectTransform.sizeDelta = new Vector2(
                TotalHealthBar.rectTransform.sizeDelta.x * healthPercentage,
                CurrentHealthBar.rectTransform.sizeDelta.y
            );
        }
    }

    void UpdateHealthBar()
    {
    float healthRatio = playerHealth.currentHealth / playerHealth.maxHealth;

    float totalBarWidth = TotalHealthBar.rectTransform.rect.width;

    CurrentHealthBar.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, totalBarWidth);
    
    //CurrentHealthBar.rectTransform.anchoredPosition = TotalHealthBar.rectTransform.anchoredPosition;
    }
}
lilac relic
#

i like how 3 people have been asking for help in here today, none of which have gotten any help -_-

azure flame
red onyx
azure flame
#

they are monospaced fonts perhaps

#

those keep spacing despite letters size

azure flame
red onyx
# azure flame they are monospaced fonts perhaps

Maybe textmeshpro itself? Because the other font i used was its default font, and legacy text doesn't do what textmeshpro is doing, but I still need textmeshpro for some effects I gotta do on the text later on