#📲┃ui-ux

1 messages · Page 35 of 1

molten hill
brisk monolith
meager cairn
#

Cannot interact with pause menu even tho I have attacked bahaviours on click

#

I can't even see/move my cursor

#

I could go over to the button, but it has no effect when I click the button

mortal robin
mortal robin
#

The answer is to unlock it when you're in the menu

meager cairn
meager cairn
#

Yes there is

mortal robin
#

But yeah you said your mouse is not visible

meager cairn
meager cairn
#

but still uninteractable

mortal robin
#

Wdym

meager cairn
#

I could move my cursor but when I click on the buttons still no response

mortal robin
#

You might simply have other UI stuff blocking it

meager cairn
#

it's the only UI I have currently

mortal robin
#

Like the canvas is a child of the player or something?

#

That's quite odd, I would fix that

meager cairn
#

do I need to call to enable the event manager

#

(the input map i mean)

mortal robin
meager cairn
#

no hover reactions

mortal robin
# meager cairn nope

Make a new scene. Put an event system in it, then copy your pause menu into it

#

See if it works there

#

If so, the issue is with something in the real scene blocking it

meager cairn
#

nope

#

not working still

#

no hovers and stuff

#

ignore the error, it's only for disabling player input of the game

#

seems like there's something wrong with the setup

#

is it because it's a prefab?

dreamy bay
#

moving here on the recommendations of others. I'm trying to create a widget that is a row and is a 1/3 2/3 split. I currently have everything almost perfect except for the entire row trying to be 100 tall instead of fitting to the content in NameContainer and ValueContainer. Is there a default place the 100 is being set that I need to explicitly override? https://pastebin.com/TRnC1xrK

meager cairn
spiral fog
#

building the game results in the UI not working in the built game, but works fine in the editor dense

tribal latch
#

you should show the whole UI structure

meager cairn
#

Entire structure

tribal latch
#

are there nested canvases? What's on Pause and PauseMenu?

meager cairn
tribal latch
#

does your nested canvas also have a GraphicRaycaster?

meager cairn
#

yep

meager cairn
tribal latch
# meager cairn yep

create a new scene containing only your UI (I suggest convert it into a prefab temporarily) and test it there to eliminate other possibilities. Are you using the new or old input system?

#

signs are pointing to something wrong with your raycaster, things being on the wrong layer, targets not being raycastable, or interference from something else

meager cairn
#

should I make a new mapping?

tribal latch
#

did you modify the default one? maybe it's time to break out the input debugger if they don't work in a clean scene

meager cairn
#

maybe that's the issue

meager cairn
#

I just tried

#

did not work

#

tried remaking the buttons

#

did not work

#

seems like a script issue, the cursor could not interact with the ui at all

tribal latch
#

unless you're talking about some kind of bug in the ui system, that sounds exactly backwards

#

if you messed with or are not using the default input asset, you need to work backwards to figure out what you broke exactly

meager cairn
#

Ight

meager cairn
tribal latch
#

if they have animators it does

meager cairn
#

I'm just gonna make the UI from scratch in another scene and port it over

meager cairn
#

Alright I think I found the problem

#

when I disable the player altogether it works

#

it doesn't have a render scene however

high walrus
#

do we have single toggle group that can enable multiple selection? or similar built in features?

humble relic
high walrus
#

ok

#

ty

polar echo
#

guys big money question, is it possible to have:

  1. a vertical layout group
    └──an element with a flexible height (that element is a scrollrect)
    └──the scroll rect content (that is also a vertical layout group)
    ^^right now I'm getting stuck on this point, no matter what I try to do this element is basically either the size of the parent element if i stretch it to fill the parent, or it is centered within the parent with basically 0 height

the only solution that works perfectly is adding a content size fitter to the content but that gives off the warning: "parent has a type of layout group component..."

so I'm not sure what to do

#

maybe more generally speaking can I have a child overflow its parent when that parent is a layout element inside of a vertical layout group?

polar echo
winged yew
#

I could use a little help with layout group stuff. I have all of these in a Vertical layout group. All of the items stretch horizontally in the group. But I'd like the green button at the top to be a fixed width. I tried adding a Layout Element to it with a preferred width, but that didn't work at all

mortal robin
coral musk
#

Does anyone know to script a text mesh pro to fade in or fade out or any UI

mortal robin
#

or use a canvas group and change the alpha on that over time

coral musk
#

I don’t know how to script that

dreamy bay
hushed bone
#

I have an issue with scroll rects. There are many messages here in this chat, but the scrolling just doesn't work. When I use unrestricted I can scroll freely. When I use clamped it doesn't let me scroll at all, becasue I think unity thinks what's visible is all the content there is. And when I use elastic it always snaps back to the center. What am I doing wrong?

mortal robin
#

looking at your screenshot it's a bit confusing because I don't see a viewport

#

Normally when you create a ScrollRect you get like:

ScrollRect
  Viewport
    Content
hushed bone
#

I don't see a way to create a scrollrect in unity so I tried to make one manually

#

How do I exactly do that?

mortal robin
hushed bone
mortal robin
#

Scroll View

indigo cedar
#

So, these are my save files.

Problem I am facing:

The left picture is how it should display my save file.
I made some changes and tweaks so that the UI is scrollable in case when more files are created they arent going outside the ui.

After I did that, for some reason, they got smushed into each other like the picture on the right.

"ScrollArea" is the Mask for the scroll area where the save slots should stay in

Edit: I managed to spread them out with spacing in the inspector, but my button area (the white behind the text) is still incredibly small and when I add another save file, they get smushed again

cedar spindle
#

Stupid question but is there anyway to have a child rect transform with Ipointenter to triggers its point enter rather then the parents? Semms like a simple ovveride but cant get it to work. Moving the child is not really a good option

low pike
cedar spindle
#

That doesnt seem to be default behavior

low pike
#

show your issue/ setup/ code

cedar spindle
#

Ok so I have a parent object with a rect transform and an Ipointenter and an image.
I also have a child that is not overlapping
The parent triggers a mouse over text at the mouse position and that is all good. The problem is that when
i hoover the child object than that also triggers the parents mouse over effect that blocks its own and thats not good.
So I would like for the child to ignore the parents.

#

So both parent and child have a raycast target that is working as intended. All is setup during runtime and is procedureally generated and I need to keep it that way

low pike
#

show it.. with screenshots/ video

cedar spindle
#

Never mind the really ugly TEMP ai art

#

its very much just placeholders

#

So basicly the text should be childern av the other raycast target

#

the text is a very simple asset:

using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;

public class SimpleTextAsset : MonoBehaviour,IPointerEnterHandler, IPointerExitHandler
{
    public TextMeshProUGUI text;
    public string textContent;
    public string onMouseOverText;
    public static SimpleTextAsset Create(string _text, Transform _parent, string _onMouseOverText = "" )
    {
        GameObject go = Instantiate(Resources.Load("SimpleTextAsset"),_parent) as GameObject;
        SimpleTextAsset simpleTextAsset = go.GetComponent<SimpleTextAsset>();

        if (simpleTextAsset == null)
        {
            Debug.LogError("SimpleTextAsset component not found on the instantiated object.");
            return null;
        }

        simpleTextAsset.text.text = _text;
        simpleTextAsset.textContent = _text;  
        simpleTextAsset.onMouseOverText = string.IsNullOrEmpty(_onMouseOverText) ? _text : _onMouseOverText;
        Debug.Log($"[SimpleTextAsset.Create] textContent set to: {simpleTextAsset.textContent}");
        return simpleTextAsset;
    }
    public void OnPointerEnter(PointerEventData eventData)
    {

            Debug.Log("onpoint enter");
            GlobalActions._DoShowToolTip?.Invoke(new TextOnScreenArgs { text = onMouseOverText, time = 999f });
        
        
    }

    public void OnPointerExit(PointerEventData eventData)
    {
        GlobalActions._DoHideTooltip?.Invoke();
    }
}
#

I know there are some not that complex work arounds with simple grid layout or just my own layout och raycasting system but would be nice if there is a simpler way around it

#

or ofcourse unparnting but keeping world pos but then i will ned to handle a lot of weird cases when we resuply shop or items are removed and would love to not have to do that

#

So just to be super clear im not asking for way around the problem but rather if anyone know a way for a child with a raycast target has the ability to ignore the raycast target of its parent with the Ipoint interfaces

restive wing
#

Hi guys, when I instantiate a world space canvas at runtime the buttons stop working, but if the canvas is there from before I run the game the buttons work, any help?

cedar spindle
#

Missing event system? @restive wing

#

or graphics raycaster on canvas maybee

restive wing
#

i have all of these thats the thing

hushed bone
#

When using a vertical layout in a canvas, is it not supposed to work with empty gameobjects that have children? Like, in the content section. How do I make the empty gameobjects with ui elements as children work in a vertical layout?

#

When I put the children gameobjects as direct children of content they work, but not when it's within an empty object that acts as a container for these three objects

#

I think I managed to do something just by creating a rawimage and then placing the other ui elements as children. But this gives me a weird effect where everything spawns in a different, weird location. How can I ensure my vertical layout only uses the image's position and keeps the other elements, children of the image, in the same relative position to the image?

#

Nevermind, it was an issue with one specific object's anchors, it's all solved

hushed bone
#

Okay, another question I have. When using a scroll rect, I scroll down and it works perfectly. As well as scrolling up, but when I get to the end of the list, I don't know why, but it lets me scroll down a little bit further, leaving an empty space in the scrollrect

mortal robin
hushed bone
high walrus
#

can built in scroll rect do this?

#

its horizontal scroll, there are no scrollbar, the whole view is a scroll

steep warren
serene bison
#

Is anyone free to help out with can issue I'm getting? I'm getting a NullReferenceException: Object reference not set to an instance of an object in my LoadData method.

using TMPro;
using UnityEngine;

public class PlayerPref_Manager : MonoBehaviour
{
  [Header("Int Counter")]
  public int intValue = 0;
  [SerializeField] GameObject intText;

  [Header("Float Counter")]
  public float floatValue = 0f;
  [SerializeField] GameObject floatText;

  [Header("String Input")]
  [SerializeField] GameObject stringInput;
  [SerializeField] GameObject stringDisplay;

  void Start()
  {
    LoadData();
    UpdateUI();
  }

  public void IncrementInt()
  {
    intValue += 1;
    UpdateUI();
  }

  public void IncrementFloat()
  {
    floatValue += 1f;
    UpdateUI();
  }

  public void OnStringChanged()
  {
    if (stringInput != null && stringDisplay != null)
    {
      string inputText = stringInput.GetComponent<TMP_InputField>().text;
      stringDisplay.GetComponent<TMP_Text>().text = inputText;
    }
  }

  public void SaveData()
  {
    string inputText = "";
    if (stringInput != null)
    {
      inputText = stringInput.GetComponent<TMP_InputField>().text;
    }

    PlayerPrefs.SetFloat("FloatValue", floatValue);
    PlayerPrefs.SetInt("IntValue", intValue);
    PlayerPrefs.SetString("StringValue", inputText);
    PlayerPrefs.Save();
  }

  public void LoadData()
  {
    floatValue = PlayerPrefs.GetFloat("FloatValue", 0f);
    intValue = PlayerPrefs.GetInt("IntValue", 0);

    string savedString = PlayerPrefs.GetString("StringValue", "");

    if (stringInput != null)
    {
      stringInput.GetComponent<TMP_InputField>().text = savedString;
    }

    if (stringDisplay != null)
    {
      stringDisplay.GetComponent<TMP_Text>().text = savedString;
    }
  }
}
steep warren
#

which line?

serene bison
#

Ooo. I didn't have String input assigned correctly in the inspector. It should have StringInput assigned and not StringInputText

steep warren
#

also you should have intText/floatText/etc asTMP_InputField/TMP_Text directly instead of GameObject

serene bison
#

it was this line:
stringInput.GetComponent<TMP_InputField>().text = savedString;

steep warren
serene bison
#

I changed the declaration to GameObject because it wasn't letting me assing things in the selector lol

steep warren
#

do those objects have the relevant components statically?

#

or are they created at runtime for some reason

serene bison
#

I believe they are static (by static I'm meaning I've created them in the UI manually)

steep warren
#

you should be able to assign them to the correctly-typed slots then

serene bison
#

This is what I'm building. It's a basic UI to learn how to use the PlayerPref save/load system. Even though I'll likely just use the encrypted Json Utility method in the future. Just wanted to be familiar with this before moving forward

#

I'll switch the declaration to TMP_Text/TMP_Input_field now and test

#

Aye it works! I think I was missing last time I tried was
using TMPro;

I'm pretty sure I was just doing:
using UnityEngine;
using UnityEngine.UI

#

Thank you Chris, I'm smooth sailing now. (Hopefully I didn't just jinx it)

gaunt tartan
#

Context

In HTML/CSS, I can just do The <span background="style: background: url(glitter.gif)">Glitter Monster</span> has appeared! which is really easy.

Problem

I can't do this easily in Unity. I tried The <sprite anim=0,5,10>Glitter Monster has appeared!, fiddling around with <mspace> but I can't seem to get it to work. I want the sprite to cover the width of the monster's name, and the monster's name can be arbitrarily long. Is there a way to add a background behind specific text in Unity?

timid mural
#

is there a way to make my UI follow this slant with a layout group or should i just do it manually?

humble relic
# timid mural is there a way to make my UI follow this slant with a layout group or should i j...

Do it manually: layout groups work with a rect, so if you use a rect and tilt it to align it, then the children (the buttons and their texts) will also be tilted.
Or you can create your own layout group by duplicating or inheriting the vertical layout group and adjusting the offset of each item, but this will take more time...
Or another solution: use a vertical layout group that you tilt, and create script for buttons so that they tilt in the opposite direction to compensate. 🤷‍♂️

humble relic
timid mural
slim sparrow
#

my UI text is doing this weird ghosting thing. im changing it in update with debugText.text = moveInputSmoothed.ToString();

im not instantiating new instances of it, and i checked camera settings and it seems to be fine. chatGPT and google were not able to help me either 🥲

humble relic
slim sparrow
humble relic
slim sparrow
humble relic
humble relic
#

and the inspector view of the Canvas?

humble relic
#

And the Inspector view of the TMP_Text component itself?

humble relic
# slim sparrow

Actually, it could be a TMP-specific issue related to URP. Sometimes when switching to URP, the default TMP shaders or materials don’t work perfectly.

You might want to try:

  • Reimporting or updating the TMP package via the Package Manager.
  • Switching TMP materials/shaders to the URP-compatible ones (like TMP/Distance Field shaders adapted for URP).
  • Or simply re-adding the TMP component to your text object to reset its setup.

That often fixes weird rendering glitches after switching pipelines.

slim sparrow
#

thanks for your time btw!

humble relic
# slim sparrow ah ok so i just fixed it right now by switching to "Screen Space - Camera", any ...

Nice! Glad that worked!

Yeah, in URP, Screen Space - Overlay sometimes has rendering issues because it's handled differently from the Built-in pipeline. URP doesn’t officially support it the same way, and some features like post-processing, custom shaders, or even TMP materials might not play nicely with Overlay mode.

By switching to Screen Space - Camera, you're letting URP render the UI through the camera, which gives it better control over lighting, post-processing, and depth sorting. That’s why it usually behaves better in URP setups.

And you're very welcome, happy to help!

dreamy bay
#

I'm using a TMP_InputField and I have it correctly displaying with starting text. When I select the text area I get a log message from OnSelect but the carat never displays and i can't type. What should I be looking at to get it working?

wind flicker
#

are there any cool free UI assets ?

#

game game looks hella sad with just default buttons and panels xd

molten hill
#

@wind flicker I do not know if it is cool enough but you can purchase per 2$ this pack and it is contain the Cartoon GUI Pack https://assetstore.unity.com/mega-bundles/quick-start

Unlock a bundle of top-rated assets, including tools for 2D and 3D design, FPS frameworks, RPG kits, and more—perfect for projects with minimal coding required.

wind flicker
#

hmm i mean it would work but idk

#

im a bit confused about 2d gui and 3d gui

#

its listed in 3d gui. isnt this just models?

molten hill
#

This one is polygon icons pack . In one of my game I use 3d models like Rawimages with rotation animation it looks nice. So you can use them same way

wind flicker
molten hill
#

You can use RenderTexture display it in Raw Image to make polygon packs looks like a 2d UI with 3d effect I did in one of my game it looks like this the star and shop icon is 3d but displayed in 2d RawImage

wind flicker
#

ohh i see

lyric rose
#

How to make parent layout group be the size of all child elements?

#

And really any parent to be the size of the children

lyric rose
#

Content Size Fitter seems to do it.

dark night
#

trying to set alpha is transparency on this image, but when I check it, the apply button remains grayed out. I've had no issues doing this previously and can't find anything online. anyone got any idea what might be causing this?

#

has also begun happening to every other image in the project, I haven't added any new packages since.

#

I actually can't apply any of those top-most settings

#

nvm got it, apparently you can't change import settings while in debug mode

quiet hare
#

finnally that i have manage to get through with the (princess peach rescue toad type of thing) problem, but however there is still one small problem, which is that when i appear in a stage and set to rescue that certain gameObject by interacting with it, but however when i do that, the UI Image doesn't change to already rescuedimage. while i am trying to figure out

https://paste.mod.gg/kptuutikvhwu/0

quiet hare
#

when trying to rescue a muon, this happens instead of just the certain id

shut torrent
#

Hey there! I'm building a 2D pixel game where most of the gameplay happens through mouse clicks on one central game board. I plan to have a lot of small moving animations/particle effects alongside buttons on the game board and was wondering if there's any significant difference in using 2D sprite renderers vs small, individual canvases in world space on each object w/ a UI Image that needs it? I would build everything into a single canvas, but I wanted to avoid so many draw calls on a main canvas since all the little parts will change frequently, plus the separation of the game board from screen space overlay ui is handy

#

I was thinking to place non-interactables as 2D sprite renderers and animate them off scripts when needed, and then just have all the buttons and text and such on small canvases that update only when needed

drifting matrix
#

you have to click the same button you shoot with to accept the selection

polar echo
#

Hello, I have a question.
How would I handle having world space text mesh pro text with a pixel perfect camera that has upscaling turned on.

Right now my in-game text gets blurred into unrecognizable pixels.

The only possible solution I've found would be to use a stacked camera with the pixel perfect one rendering everything but text and the second one rendering the text only, but I'm not sure if that's the best solution since I get a warning that pixel perfect cameras should not be stacked and the stacked camera would need to sync its properties to the pixel perfect one for the text to not appear shifted.

prisma moat
#

How could I improve my Win Screen? I don't like it so far

wind flicker
#

i wish i'd know how to make this pretty lol

mild kernel
#
Game UI Database

The ultimate tool for Game UI and Interface designers. Explore over 1,300 games and 55,000 UI screenshots. Browse and filter by category, animation, colour, material, layout, game genre, and more.

wind flicker
#

is there a tutorial somewhere or a guide or something how to create own gui elements? or is it just do smth in gimp/photoshop and save as png? xd

wind flicker
tired inlet
wind flicker
#

upscaling and stuff does make the quality weird. doesnt it

tired inlet
#

there are many workarounds to prevent that and keep the visual quality

wind flicker
tired inlet
#

yep, sounds good to me

wind flicker
#

aight thanks !
i try to figure something out then :3

tired inlet
#

the visual aspect is the smallest issue, keeping the ui at the right position cross plattform and device is important, but that is really simple, you just use anchored positions

wind flicker
#

but i dont rly understand the use of like vertical layout group. why would i use this when i can just freely move buttons? idk it just seem to useless limit element moving

tired inlet
#

many many advantages of the grouping elements.

#

but if you are not sure, you dont have to use them.

wind flicker
#

aight !

#

i hope my game comes to live soon. i have someone who helps me out with menu elements. lets see how well this works

tired inlet
#

you can skip the beautifying for now, just concentrate on making the game work

#

during this phase you might find a few people wanting to help you out

wind flicker
tired inlet
#

what kind of game is it

wind flicker
tired inlet
#

and you went for multiplayer right as i can see from the screenshot

wind flicker
tired inlet
#

wow, what system are you using

wind flicker
#

But i didnt think about something

wind flicker
#

Unity netcode

tired inlet
#

nice

wind flicker
#

Yep. But i didnt think about the fact i want like office upgrades but everyone gets money and idk if i want to remove the money from both on upgrade bought or just the host or whatever. Idk gotta think about it 😂 because the Fact that when u play singleplayer u have nothing when all Ur money was Drained in multiplayer or idk. I gotta see what i do. Wrong channel to Discuss about i think

molten hill
#

@wind flicker in vertical/horizontal layout groups you can dinamically add elemets and it will display any amount of elements correct that is usage case. If you for example load uncknown numbers of users from server and display their rank

#

you just instantiate pefabs inside content and horizontal/vertical layout will do the job

grizzled inlet
#

Hey guys

mild kernel
#

That is far too vague 🤷‍♂️

#

Also don't crosspost please

grizzled inlet
mortal robin
#

jsut do this but then also put 3D objects in the scene

#

get rid of the big opaque UI panels so you can see 3D objects

grizzled inlet
#

I got it right here, don't I?

mortal robin
#

I'm not sure what you're trying to show with this

grizzled inlet
#

If I remove the camera, only the UI is shown.

mortal robin
#

Is there a question here?

grizzled inlet
#

I can't understand why the 3d object overlaps the UI.

mortal robin
mortal robin
#

if you use Screen Space Overlay the UI will always show on top

fringe roost
#

Hello there, I've a 3D Scene with a UI in 3D Space... problem is that I can't find a URP Shader for UI that support LIT.
Any advice to avoid the auto-illumination style of Unity UI?

coral musk
#

Do you have auto generate lighting off?

dreamy bay
#

i'm having trouble getting my TMP input field to work. I have it fulled declared and displaying properly. I have defined the default text and the placeholder text as well. When I click on it I see that the OnSelect runs correctly (via a log statement on the listener) and the background is visually dimmed while clicking. However, I don't see the blinking carat and I can't type. Is this something any of you have ever experienced before?

steep warren
dreamy bay
#

guess i should have just asked the question without that part

steep warren
#

the issue with asking stuff about modding is two-fold - there's the legal issues of course, but there's also the part about it being an atypical context
not having the normal tools as you would in your own project or having other constraints makes it kinda impractical to really support in the general help space

dreamy bay
#

I get that. I'm not going to argue, just pointing out that if I had said "I'm challenging myself to only do it in C#" It wouldn't have been an issue

ionic beacon
#

We've seen that many times, it won't work

steep warren
quiet hare
fringe roost
#

I'm not sure if still the right channel... anyway I've made a meterial with the ShaderGraph to have UI canvast that can react to Light and receive shadow...
Then I've used "Seed code" (I guess) button, to have the compiled shader, copy/pasted the entire shader in a new file and then I've added the Stencil stuff which was missing to work correctly with the UI Mask!

It's working 🥳
BUT ... there are some transparent element which still visible... a bit.

Maybe it's because the surface still reflect the light, but event with _Smoothness = 0 still have the same issue.

polar echo
#

Hello, is it possible to stack pixel perfect cameras with the URP?

rigid egret
unborn citrus
#

is it possible to somehow align 2 groups of words in the same line, like I want NAME - DATA, where NAME would be on the left and DATA on the right of the textbox
I'm using TMPro, I tried using <align> but that only shifts an entire line

molten hill
#

@unborn citrus you need to create two text labels first set to left second set to right

#

if you need such logic

unborn citrus
#

yeah I know I can do that I just wanted to see if I could do it in 1

molten hill
#

in one you can only create your custom aligner (text formatter) that will manually do the job.

serene bison
#

has anyone seen this before?
My game view is grey and I thought it was due to a canvas but I've disabled it and still seeing the grey?

#

oh, it's due to the .fbx asset i just added. Not sure why it's making my game view grey when it's no where near the camera

plain plank
#

Hi guys! new to unity but would love some feedback on this cutscene/main menu im making! thank you v much!

coral musk
#

Not bad, except that fade into the main menu you can add a fade to make it better (you can ask me for a script for the fade if you want)

plain plank
#

oooh thats a great idea! thanks!

vestal dust
#

I would actually expect "play" to be where "out" is on the sign? The text on there feels big and clickable

plain plank
wind flicker
#

i rly hate the Scrollview in unity. i have code to generate content for the scrollview but its not generating anything or i am dumb and cant see it. i think its an UI issue

low pike
rough tree
#

hello, i need some help! i managed to make this responsive ui via script. But i would like to know if it is posible to achieve the same result using unity componets in the ui

wind flicker
tired inlet
rough tree
tired inlet
#

can´t you make the layout group strech instead.

rough tree
#

yep, stretch is set in my content rect transform (the same object containig the layout group), but the layoutgr requires setting a cell size o the x and y

tired inlet
#

i made something like you have there a few months ago, and i remember i did not have any issues whatsoever.

low pike
#

afaik Unity does not have anything that will auto move elements around like in the video shown

tired inlet
#

is it just the strecthing of the child elements you are asking?

#

and regrouping as soon as you make the container smaller

rough tree
#

yep the childs are the ones that should stretch, depending on the width of the rect transform

tired inlet
#

could you sent it as mp4

rough tree
#

yes sorry

tired inlet
#

so we can play it here embeded

rough tree
#

thats the difference

#

in the right video it changes the cell sixe x value to adapt to the screen width

tired inlet
#

please explain i am confused. are you looking for a minimum x size?

#

i can see that you are resizing the cells in the right video but it is unclear why

low pike
#

It's web flexbox stuff

tired inlet
rough tree
tired inlet
#

i see now. did you try the scale with screen size on your canvas scaler

low pike
#

That's not relevant to this, that's for the entire canvas.. not individual elements

rough tree
#

i do have scale with screen size in my canvas, ref res is 1080x1920 and match height so in all devices that canvas is half the size of the screen, mobile or desktop

tired inlet
#

then i am really out of ideas mate

#

maybe it is the only soloution as you have it with some code

low pike
#

Yes, you have to buy an asset or code this yourself

#

Or use UITK - that might do it

#

as that's inspired by web UI

rough tree
#

yep, i tried every ui component but looks like my only option is through code

#

i mean it works but maybe is more optimus using ui components

low pike
#

I'm certain #🧰┃ui-toolkit can do it.. if you're not far into development it's worth evaluating

rough tree
#

thanks i will look into ui toolkit

wind flicker
#

what do i need to check here? left side is in editor, right is ingame. usually it should create Prefab inside the Scrollview but for some reason it dont and idk if thats an UI or an Code issue

mortal robin
#

if it isn't, then it's a code issue

wind flicker
#

or right it should spawn inside the Content of the Scrollview right

#

it is spawning

#

even looks correct when i activate the SkillDetailsPanel

#

might be an issue with my prefab itself think

#

when i click anything from there from the prefab canvas it shows to be there

mortal robin
wind flicker
#

got it. was an problem with my prefab itself

#

theres still the issue that the right side isnt showing up. but atleast the prefabs are here now

swift basin
#

I think I am going crazy, what am I doing wrong here? How can these images (they are on Canvas) be on top of the UI BUT below the floor WHILE the UI is on top of the floor?

#

HOW?

pallid canyon
#

Some characters also have the wrong height

safe cave
#

Hello guys

warm sail
#

Guys, I need some help
I'm making this game UI right here, with the middle box being the Raw Image. The main camera is set to use Texture as the output mode, which is using the texture the Raw Image will use.
For now, it moves smooth and I can work with the "screen" like this, but when I test the game, it gives this kind of error when the game moves.
How can I fix it? Adding a second camera removes the warning and the after image effect but it tanks the performance too much to be acceptable.
I'm puting this here since I can't find any channel dedicated for the camera (since I'm not using cinemachine for now)

sharp kite
#

Hi! I am making a Kahoot-style join system, and I am wondering if there are some tricks to achieve this aesthetic where there are lines that each letter snap to. The issue is that not all letters are equally wide, so they are not centered on each line. I am using TMP

#

I am thinking that I can maybe make an invisible input field that the player types in. Then using a script I can set each letter individually (one TMP_Text per letter)

tawdry cape
#

I have a panel with Grid Layout Group, and when I put stuff inside it, the object gets in a slightly wrong position like this. When I click on the panel, it seems the selection area is slightly bigger than what it looks like, as in the second image. It's likely that this selection area affects the grid layout, my question is how to fix it

wind flicker
#

i have a panel, inside the panel i spawn a prefab with a canvas by code, the prefab is seen in the hierachy so its getting spawned, but i cant see it inside the scene/game view, what could be the issue?

tribal latch
#

wrong layer, bad position, invalid dimensions, tiny or zero scale. Just mess with it when it's spawned in play mode to figure it out

wind flicker
tribal latch
#

scale is zero

wind flicker
#

u right ...

#

but that happens when i drag out the content from the prefab in the main scene, inside the prefab its still not visible

#

wait im dumb. thanks !

#

for some reason the scale from the canvas get set to 0,0,0

mortal robin
#

Use MP4 to embed videos in discord

last arrow
#

Hello everyone, I am having a challenge with my UI, my hud is inverted and not working, if I turn off post processing it behaves normal. I am making use of my own 2d URP.

Has anyone experienced this if yes: how can I fix it.

Thanks

mortal robin
#

what are you expecting it to do that it is not doing?

obsidian steeple
#

why when i instantiate a gameobject with an image component the image is always invisible ? its on top of the hierarchy and the inspector shows that it has an image assigned. please help i've been losing my mind to this bug for days

mortal robin
#

you also have an error in your console (maybe related or maybe not)

obsidian steeple
#

i think imma take a break from unity

mortal robin
# obsidian steeple omfg

Strong recommendation about using and instantiating UI prefabs at runtime:

  • In the prefab make sure the anchor preset is set to Full Stretch (bottom right of the anchor presets menu)
  • When you instantiate the obejct, use the form that looks like Instantiate(thePrefab, theParent)
last arrow
mossy tendon
#

Need help figuring out how to properly do a thing
Running into an issue with my prefab atm where I want to have it so when more text is added it expands the text object's size rightward instead of horizontally in both directions and I'm unsure how to properly do that
The text object is in a parent object with a horizontal layout group and content size fitter comp, with the text object also having a content size fitter comp also

mortal robin
mossy tendon
mossy tendon
#

Okay figured out the issue
My pivot for the parent object was set to the wrong thing

desert python
#

Why does this happen? In the editor, everything is looking fine... (I know it looks ugly dw abt it)

low pike
desert python
#

I'm sorry. So my problem is that the buttons are not in the corners as I set them up in the editor.

low pike
#

you've probably anchored them to the center, and not the corners.. so changing the screen size keeps them that distance away from the center.

#

!learn -> 👇 do UI tutorials

onyx flowerBOT
#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

desert python
#

Alright, thank you.

spark thunder
#

What do you think about UI/UX in a situation when player received more experience than it's needed to level up?

Is it okay to show 9/5 exp points in progress bar?

If promotions is failed I show a progress bar with current experience and substract amount that was needed for promotion.

tired inlet
#

well 9/5 looks really weird. it is like saying you gained 90 of 50 points in your exam.

plain plank
#

Hi guys, could you give me some feedback on this ui mockup?

mortal robin
lilac relic
#

why can't my scrollbar reach the bottom here? I am going crazy trying to either fix it myself or find any help to fix it.

coral musk
#

What Unity version are you using?

plain plank
steep warren
fossil shale
#

Does anyone know why these sprite assets are different sizes when I use different fonts?

molten hill
#

arganoid you can use AutoSize option if you use textmeshpro. Currently your second font is bigger than first font so last line taking 2 rows instead of one row.

fossil shale
molten hill
#

looks like it is bigger even icons bigger are you sure you use the same size?

#

the right picture the icon in the center is much bigger then same icon on left picture

#

same with tire

fossil shale
#

They are both size 36 and it's the same sprite assets

molten hill
#

try to use AutoSize it can fix your problem set min size and max size

#

fonts looks the same but sprites sizes is different

quartz whale
#

how does one make ui that doesnt change with screensize? I'm trying to make stuff look the same everywhere with a mix of sprites and UI if possible

steep warren
#

a canvas scaler that's set up properly

#

also good anchoring

quartz whale
#

anchoring won't line up with spriterenderers though

steep warren
#

depends on the anchoring and how your sprites move

#

if your sprites are supposed to be perfectly in line and in sync with UI, then.. isn't that just more UI

quartz whale
#

maybe

#

you might actually be right

#

so much to change now though 😭

grizzled inlet
#

Why does the click only work if you press the center of the button?

atomic fox
#

Is there a way to set the maximum line length in TMPro? I would like to insert a "\n" after every X characters.
I tried doing it through code, but it doesn't work well with tags.

atomic fox
# mortal robin Just set the margins

The text length is variable every time, margins don't work for every scenario.
Fixed it by setting the rectTransform size based on the text length and manually inserting a "/n" in the string

grizzled inlet
#

help guys

steep warren
#

!ask

onyx flowerBOT
grizzled inlet
steep warren
#

bump your question, i'm not psychic to know lol

azure flame
grizzled inlet
#

Only work if you press the center of the button

azure flame
#

Buttons do not care how they are resized, the click area is the image area, unless something else reduces/obstructs it

grizzled inlet
#

new canvas and one button and it still only works from the center.

azure flame
#

Examine the image asset in edit mode, if it has weird border/collision overrides

azure flame
#

nvm custom outline or physics shape do not affect UI button shape

#

Did you check the EventSystem?

grizzled inlet
azure flame
#

Also just create a default button and assign the sprite there to remove any weird settings overrides

grizzled inlet
#

Yeah, I've done it all, and with these buttons it's like this.

azure flame
#

What do you have in the Raycast Padding on the image?

#

Other than that have no idea what is being misconfigured. Default button, with custom sprite, can be resized in any way and works perfectly well.

boreal dust
#

Hi im currently working on my first proper project and have got to the point where I need to work on the UI but the problems I am having is that I cannot get things to look decent enough across many devices it will be for Mobile/tablets I have it locked to portrait mode, I have the main menu looking pretty good across multiple devices(excluding some tablets) but im struggling with the game scene Mainly the Reelholder at the bottom, im using a mix of a custom scripts that force panels to be 100% width and height of all panels will add up to 100 for coverage and verticle layout/content size fitters can provide screenshots if anyone is able to provide a bit more insight, The main devices im testing on is Iphone 13 pro, z flip, 640x1136 to represent smaller phones and then 1668x2420 to represent tablets any insight is appreciated

boreal dust
#

I also have subtitles but when trying to change the mark background to fully darker its changeing the text itself so if i go full opaque background on mark the whole thing is just black this is the line im using thats with it being 80 transparency but its effecting the words aswell
subtitleText.text += $" <mark=#00000080>{word}</mark>";
}

steep warren
#

yeah, mark is like a highlighter over both text and the background

#

you could just have it a child of an image with that color

#

-# omg it's the carwash that answered this same thing in a forum thread 😆

low pike
#

I don't remember doing that ;p

steep warren
low pike
#

I've slept a lot since then !

#

I guess the dev never got around to revising the geometry creation process

slender viper
#

Can someone remind me how to setup a scrollview properly so that A: it scrolls when it overflows and B: the spacing is regular when it's not 100% filled.

#

Content size fitter does the trick. Makes one wonder why it's setup improperly by default though 🙃

boreal dust
#

didnt even need to duplicate the whole panel just have it apply to a second Tmpro element which had mark applied behind the regular subtitles thanks 👍

tall ginkgo
#

Is therer a way to add an outline to my vfx if so pls lmk

static ice
#

Say I have a fixed height and a fixed font size. How would I go about dynamically sizing the width of a text component so that it always has just enough space to display all the text in a single line?

mortal robin
static ice
median latch
#

Do someone know that why I unable to apply my image sprite model in UI image object?:

tribal latch
wind flicker
#

whats wrong here? when i put any gameobjects in there they arent displayed. when i drag them out they are displayed WAYTOODANK

charred gull
#

Im so newb if it comes to UI/UX, so I found some free asset UI for my mobile game.. https://www.kenney.nl/assets/ui-pack
It has png files, but when I use it. It doesnt look like its supposed to, its blurry. I get it that the blurr comes from scaling the image since its not vector.
Any tips on how to go about the UI?
The second Image is how the asset should look

Download this package (430 assets) for free, CC0 licensed!

tired inlet
wind flicker
tired inlet
#

ok then i am pretty sure you are not aware what the componenet is actually used for

wind flicker
#

but even in my sceneview

#

i dont see the ui elements

#

on alpha 1 i shouild see it no

#

canvas group is to have parts of the ui enabled with an fade effect, no?

tired inlet
#

so you got child objects on this gameObject ?

wind flicker
#

when i move everything out of the mainlobbygroup everything is working

tired inlet
#

yeah the canvas group is taking care of them when they are grouped below

wind flicker
#

ok i found the issue ig

#

hidign behind the background lol

tired inlet
#

glad you fixed it

wind flicker
#

i rly hate ui in unity idk why

tired inlet
#

why tho

#

they provide so many helpful toosl and soloutions

#

pretty everything you need

wind flicker
#

never heard about it. might try

wind flicker
#

its so hard to make a good looking uixD

desert python
#

I'm trying to apply post-processing to text. I've already set up the global post processing, and in the scene view, everything looks right, but when I play the game, the glow completely dissapears.

low pike
#

I think you need to change the canvas to screen space - camera - post processing doesn't affect overlay

desert python
#

It works, thank you so much!

wind flicker
median latch
#

How can I create textures for human head model?

wind flicker
#

why is it so weird when my missionlistcontent got the size? isk it looks weird

#

is it a code issue here?

quartz whale
#

no idea how to make this look even - i despise the UI system does anyone have any advice? 😢

wind flicker
#

figured the mainissue out.

#

but its still weird

#

any idea whats wrong with my ui?

#

ok nvm its an prefab issue it seems

wind flicker
#

WAYTOODANK i have no idea why the icon and the reward text is messed up

#

the rewardstext has bottom left anchor the icon top left anchor

tribal latch
#

yep it's definitely wrong

wind flicker
#

got everything fixed

vapid edge
#

Is it a good practice to split my canvas into tons of subcanvases? For example if I know that 90% of my canvas is changing rarely, but there are some elements that move often, should I put the often-moving elements on a separate child canvas for preformance? Is there a real upside to this, or perhaps any downsides I should be aware of?

#

I'm talking about this from the perspective of a really canvas-heavy game

#

I assume that doing a separate subcanvas for every single element has some really unnecessary overhead so I won't do it, but is grouping elements together worthwhile, or should I not bother and find other optimisations

proud sandal
vapid edge
hollow sleet
#

I’ve heard there’s pretty rough performance implications from using OnGUI / Unity’s older GUI stuff, Is this avoidable or is it for the most part unviable to really use this as a primary way of handling game ui

#

I know we’re meant to either use the standard ui stuff or newer ui toolkit but I kind of fuck with the older GUI stuff because it’s a lot more code based like ui toolkit but strictly c# and/or exposing serialised values

mortal robin
hollow sleet
#

Yeah dabbling with it now, Just wanted to through out a vibe check incase peeps have already come to conclusions

wind flicker
median latch
#

This warning is getting popped up whenever I go in Playmode to test:

median latch
past skiff
#

Hi not sure where to post this but is there anyone working on "in game survey". I'm working on a project but i want to gather data from the user and don't really want to redirect to google forms or something. Is there something equivalent (Like sometimes i see other games doing it -- Are they using webview)

low pike
#

some will use webview , others will create it themselves in app.

slender viper
velvet scroll
#

@winged hare to continue your question here - as vertx mentioned, there is no built-in way of handling themes with the Canvas system, short of using UIToolkit as an alternative, you certainly could build your own wrapper for components you want themes for, then you can create your own global themes or even local (per-Canvas) themes this way

I do something similar with my project using ScriptableObjects to hold the theme data, and a class I use on the Canvas to reference the scriptable objects, applying the theme would be accessing for example, a buttons Image component and setting the color, or specific art, or accessing Text components and setting the specific font and size, etc - its certainly a good bit of programming work involved, but doable if you prefer not to use UIToolkit and cannot find an asset online that fits your needs

winged hare
velvet scroll
# winged hare This would be a custom theme that my artist is making. I may take the time to le...

If all you need to do is replace images with what your arist makes and set colors and fonts, you could do that with Canvas and ScriptableObject - but if you need more than that, UIToolkit would certainly allow for a lot more flexibility as the USS works very similar to CSS/web development, which means you can do stuff like gradients, rounded corners, animated button states, etc though it does certainly have a learning curve to it - aside from Unity Learn, I dont have any specific suggestions for where you could learn how to use UIToolkit, but I can suggest to try and maybe start with just a container and button to practice using all the features you plan to from your artists work, and theres a good chance you could use both UIToolkit and ScriptableObjects

winged hare
hollow sleet
#

Doing some raw GUI stuff and running into a issue and I'm not sure about the best way to solve it

I have this texture (red) that i want to fill up a given space based on a lerp im doing

I wasn't able to get DrawTextureWithTextureCoords to display anything so right now im just lerping the usual rect.width based on my lerp value.

It looks fine at that 75 value but as you can see when it gets too thin at 10 I think it's doing some mipmapping kinda thing where it's degrading into just a rectangle which starts clipping.

I'm wondering if theres either A. a way to prevent it from rectanglizing at a small scale or B. a way to properly mask this texture and/or potentially manually clear/erase a specific GUI drawn space?

past skiff
hollow sleet
hollow sleet
#

using DrawTexture with ScaleMode.ScaleAndCrop gets me so close but DrawTexture seems to ignore transparency on the texture? so my corners aren't cornering

hollow sleet
#

Thanks this is worthless

hollow sleet
#

Anyone know why GUI related calls seemingly force some sort of mipmapping when i don't have mipmapping enabled on my texture?

#

texture max size: 128

#

texture max size: 1024

median latch
#

What I have to do so that canvas can automatically adjust itself according any mobile' screen?:

celest pond
#

how do I change the color of the text of a TMPro Button?

#

not via script, just via the inspector

hollow sleet
#

There’s some colors somewhere

celest pond
#

I thought it would be like other text, but changing the vertex color or Face does nothing

#

neither of these change it, they just change the color of every other text, but not the one I am trying to change

#

nvm found it, turns out that the face color is being added to the vertex color. So I put face color to white and just set whatever I want via the vertex color

languid canyon
#

my ui works fine but when i change the resolution of my game, i am left with these blue bars on the top that i can only assume are my scene. how do i fix this?

steep warren
#

don't crosspost, post in 1 relevant channel

torpid latch
steep warren
#

there are probably both ui and code solutions, which one do you want

torpid latch
steep warren
#

then let's go there

torpid latch
alpine glade
#

how do keep gameobjects(childs) that in gameobject(perent) stay the way they look even if i stretch the perent?

steep warren
#

make sure to set anchors appropriately

alpine glade
#

how should i set them?

#

i've try to set all of them to stretch

steep warren
#

some of them need to not stretch so they get segmented properly

#

perhaps look into layout groups

alpine glade
#

with layout groups

steep warren
#

well, you gotta configure them correctly.

alpine glade
#

how to configure them?

steep warren
#

it's a whole thing, check the UI package guides

molten reef
#

I was referred to you guys.

I have a problem. What I want to do is to have a preview window that fits the screen vertically no matter the screen size.

The parent (the container) ensures that from the top and bottom that the menu and some padding is always there...

preview looks exactly like I want it to be. But at runtime the preview window is shifted to the bottom of the screen.

Could someone here help me out?

steep warren
#

how high is the seedpanel?

molten reef
#

60

Each button and the field are 50

so for some padding I set the container to Top:70

#

are they... additive?

#

They are...

Why? the container stretches the whole cnavas... why would the seed panel height and the container top value be additive if both elements stretch to the top border of the screen?

steep warren
#

what do you mean "they are additive"?

#

if both elements stretch to the top border of the screen?
they don't though

#

also what if you check scene view while in play mode

molten reef
#

i relaized they dont even though it Looks like that because in both elements have there white borders completely fill the canvas

So I assumed that the Top value AND the SeedPanel Height get calculated from the top Canvas border

steep warren
#

how is your SeedPanel's recttransform set up

molten reef
steep warren
#

ok so SeedPanel is anchored to the top and positioned to the top with a height of 60
PreviewWindowContainer is anchored to stretch with a top offset of 70

steep warren
molten reef
#

I removed the 70... now the top looks right. but in scene view (thanks) it goes over the bottom

#

I assumed the "fit in Parent" from the Aspect ratio fitter would prevent that?

steep warren
#

can you change to the rect transform tool and make sure the PreviewWindowContainer is actually where it's supposed to be

molten reef
#

Currently it is stretched over the whole cavas.

So... in my head. the lower border is the same as the canvas border.

Now the preview window should with the "fit in parent" setup not go over that lower border... but it is doing that

I think i misunderstood something very basic here ^^'

steep warren
#

the lower border should be 10 above the bottom of the canvas though, as you've set

#

well now you have top and bottom set to 0

#

you should use the rect transform tool so you can actually see where stuff is

molten reef
#

yeah I added that back after the screenshot.

This setup... produces this result

steep warren
#

use the rect transform tool, press T

molten reef
#

yeah that shifts the container... but the Window itself still sticks out at the bottom

steep warren
#

i'm not saying to move it

#

just select the tool so you can see what's going on

molten reef
#

Oh sry. Yes I did that

steep warren
#

so now set the top offset and check the child

molten reef
#

Offset looks correctly placed under the menu band

And the child has got a automatic -80... somehow?

steep warren
#

hm, that doesn't seem right

molten reef
#

thats the child setup

did I do something wrong here?

#

And Canvas Setup... maybe there is something wrong there

steep warren
molten reef
#

does not change anything

steep warren
#

yeah, setting changes will usually keep the existing layout and just change what values are presented

#

you gotta set Y pos to 0 and stuff now

#

and reduce the height, flexible height should take care of that

molten reef
#

even if I set Y to 0... at runtime it gets automatically set to -80

And the height seems to be overriding flexible height 🤔

#

cant even change the -80 to 0 at runtime... just reverts

steep warren
#

what about without the layout element? (or disable it for now)

viscid dirge
molten reef
molten reef
viscid dirge
#

nope, remove all these. Use vertical layout Group

molten reef
#

but... I want my buttons to be Horizontally alighned?

#

i changed it but all it did was to sort my buttons vertically

The Preview window child stillgets the automatic -80 adjustment

viscid dirge
molten reef
#

The Input field and all the buttons

"Seed:" is just a textMesh

#

I have to bench the problem for now. I will return later and will try solutions if you have another idea.

Thanks you both for the time so far. I hope I diddnt come along as dense ^^'

viscid dirge
#

i think, i haven't understod what your problem actually is.

viscid dirge
#

and on child add Layout Element and Tick prefred hight or width whichever needed and the value.

molten reef
knotty gate
#

Can someone help me with creating staggered UI reveal for my mobile game? There's absolutely zero tutorials on such thing on YT so please, experts guide me thoroughly

#

Without staggered UI reveal it looks boring and plain. If someone can help me achieve this or tell me how, that would be awesome.

molten reef
#

My approach would be to use raw image elements for every "item" and fade them in using the Alpha (transparency) layer

This fade would be scripted.

similar to a splash screen that most games load on game start.

#

script would basically be

Start at alpha 0f
increase alpha to 1F over X amoutn of time (quite fast in your example)

mighty ridge
#

that'd be the way id do it as well..

you can populate ur list having them all disabled..
then on each element have its own script that brings the opacity from 0 to full on awake()
then u just go thru the list and activate each element 1 at a time

molten reef
#

oh and for your use-case... do them one after the other so they are staggered naturally

#

this subtle "zoom in" while it fades in (to simulate it popping up) i would have to think about a minute...

mighty ridge
#

yup, put ur tweens, anims or w/e on each object that enabled when Awake() or Activated..
then ur main script has references to each (list or array of object) that loops thru them enabling 1 at a time

molten reef
#

I think you could target rect transform via script with localscale or something like that to let it "pop up" for a few frames with 1,05 or 1,1 scale

But never used it so i dont have details for that

mighty ridge
#

yea that'd work too.. just a bit more juice/polish

#

tweening libraries come in clutch for this type of thing

knotty gate
#

Thanks guys

wispy eagle
#

Hi!

#

Can anyone recommend me a Github repo or Asset Store asset of a comprehensive UI system that has UI Modals & Popups system that support text, images, scroll text, icon-text,...

#

If it's easy to modify and extend then would also be a huge bonus

#

thanks!

wind flicker
#

are we allowed to ask photoshop questions here related to ui?

steep warren
#

questions with using photoshop specifically? a space focused on that would be more suited to answer

wind flicker
#

yeah but i think i got my stuff already

#

but now i got an ui understanding question i think. let me figure out how to text it lol

#

so i've built that phone. the smartphone is an .png. if i want header i need to make new pngs with the background right? as the entire phone is 1 png for now.

#

not quite sure how i should handle it

steep warren
#

you would have the actual phone as one sprite and then anything you want to display in it as separate sprites (or just normal canvas elements)

wind flicker
#

hmmm maybe i got an idea here

#

idk if the idea is the best but i made an header.png

#

i can just place an text oject on it

#

i guess this works for now think

#

just need to make the screen size perfect

low pike
#

The phone should just be a border, that blue background should be separate, so that you can put whatever "inside" the border area and not have to worry about duplicating the notch/ etc with each sprite that goes inside

#

If you wanted that missions bit to scroll, you can't do that with the notch present

wind flicker
#

i have it layers like this

#

delete the blue, just have the border as background and have the blue seperate?

#

it looks like this ingame rn

low pike
#

blue seperate, you'll still want a "back" of the phone in Unity -> though I'd have it white so I can set the colour to whatever I want in Unity

wind flicker
#

im completly lost rn. like this?

#

it is like this rn. the SmartPhoneUI is an empty gameobject. the PhoneFrame is the background with the entire phone image. the header is an empty gameobject with an image of the blue thing aswell with an text object and button. the missionlistpanel is an scrollview

#

the actual screen thing

steady kraken
#

I'm working on a dialouge system and right now I have the charaacters displaying character by character but now I want to make something so when you go to the next dialouge the text first flies away letter by letter. Is this possible

steep warren
#

why wouldn't it be

wind flicker
#

hows the best way to make the buttons (the icons) make perfect spaces? i need horizontal + vertical as there are more rows. i cant just use vertical and horizontal grid layout. can i? the nexts are extra

steep warren
#

i cant just use vertical and horizontal grid layout
why not?

wind flicker
#

problem ios

#

as i have the text in there aswell

#

its 2 elements

steep warren
#

right, that'd mean they exist as separate cells, but you want them to occupy the same cell, so make them part of the same object (have them both nested in a common parent)

#

so your hierarchy would be something like this

  • AppButtons
    • Mission
      • MissionButton
      • MissionText
    • Mission
      • MissionButton
      • MissionText
        etc
wind flicker
#

i have it like this now

#

thanks

steep warren
#

🤨 idk about that... check your rect transforms to make sure they're bounded correctly

#

otherwise you'll be getting overlapping elements

wind flicker
#

the problem is i use empty gameobjects and they are always 0,0,0 so i have to manually make this stuff in the correct position. idk

#

im very bad with ui stuff

steep warren
#

not sure what you mean by that

#

empty gameobjects are fine

wind flicker
#

yeah but this position now is hella weird

steep warren
#

please just use the rect transform tool

#

it'll let you actually see what you're working with

wind flicker
#

i gotta check that

steep warren
#

make sure to set your anchors and pivots appropriately

wind flicker
#

how do i make it so i have 3 in 1 row and then can have 4 rows down of buttons with the layout group btw?

steep warren
wind flicker
#

okay lemme see

steep warren
#

that doesn't actually answer your question but it'll make your life much easier

#

set its size appropriately and it'll all fall into place

wind flicker
#

i mean i think it is

steep warren
#

you think what is what?

wind flicker
#

its all in correct position

#

idk if left and right is the exact position but thats some math stuff i gotta do

steep warren
#

you already have an object set up to align with the screen

#

you do not have to do any math

wind flicker
#

im so confused rn. i wish my english would be better, would make stuff much easier lol

steep warren
#

you still have not selected the rect transform tool

wind flicker
#

i did before

steep warren
#

ah ok at least you know how to

wind flicker
steep warren
#

that.. does not seem correct

wind flicker
#

thats the empty gameobject

steep warren
#

for the mission?

#

or for what

wind flicker
#

its this

steep warren
#

yeah that's definitely wrong

wind flicker
steep warren
#

make that span the area you want your missions to show up in

wind flicker
#

oh

#

the emptygameobject?

steep warren
#

it's the one with the layout, right?

wind flicker
#

yea

steep warren
#

it's the thing you define as "all the missions"

#

so make it take up the space that "all the missions" would be in

wind flicker
#

ScreenApps is the entire gameObject wich shows the timeText, AppButtons is the actual apps

#

actually u been right

#

im dumb

#

now my empty gameobject is on 0,0,0 aswell and it all does the magic itself ig

#

so u think i should not use the horizontal and vertical group

steep warren
#

you want a grid, so why not use the grid

wind flicker
#

instead i use grid layo

steep warren
#

it'll handle overflow into the second row for you

wind flicker
#

but now the icons got to 100x100 instead of 70x70 wich is the source

steep warren
wind flicker
#

and it dont let me change it

#

oh

#

cell size

#

is this correct?

steep warren
# wind flicker is this correct?

instead of setting insane padding, set the y position and reduce the size to make the AppButtons rect span the area you want your missions to show up in

wind flicker
#

thanks

#

u right

#

below the time

#

this seems to work :3

steep warren
#

(although you probably want to use stretch anchors to have easier offsets)

weak drift
#

I just made a default Scroll View and attached two images to content, one off screen, and added content size filter, but content's size is still zero
What am I missing?

wind flicker
#

aight thanks Chris for ur help. im happy now.

steep warren
weak drift
#

i added it to content, and what do you mean by layout properties

steep warren
weak drift
#

This on viewpoint and scroll view

#

and on the images, 10 is 100

steep warren
#

can you show your hierarchy and the content fitter setup

weak drift
steep warren
#

and what do the layout properties say on Content?

weak drift
#

the option to see them doesn't exist

#

this is just the default unity preset, do idk what's happening

steep warren
#

man i am so out of my league with this lmao

shrewd minnow
#

Hello this is my set up for the UI for my game and im running into an issue where the size of my Image in my UI canvas is not matching up with the size of the sprite renderer in the world space. My PPU for all of my sprites are 16. Is there a more elegant solution than trying to perfectly scale the transform of the UI image object to the same size as the sprite object?

mortal robin
#

The number of pixels for a sprite renderer will depend on the PPU as well as the camera orthographic size and the aspect ratio of the game window.

Likewise the number of actual pixels used for a UI element will depend on the Image component size as well as the canvas scaler settings, the render mode of the canvas, and the game window resolution

shrewd minnow
#

im just trying to make sure my UI images and sprite pixel sizes are equal and that there wont be any appearances of mixels.

#

this should be how it look

shrewd minnow
#

when image(s) have pixels that are not of the same size

distant walrus
#

i want to make something like this in my game canvas, if i add it using a different camera, i wont be able to click on it and move to that axis, Can anyone suggest a solution for this? thanks

knotty gate
#

Does any of u know how I can create a carousel horizontal UI view which I can scroll infinitely on, only show 2 buttons at a time and have smooth snapping? I literally tried, especially the carousel part, I don't think it even is possible in Unity, but if any of you know a way....

molten hill
#

@knotty gate yes you can , you mean scroll last will loop from start? But you need to code the logic there is no default logic. It is 100% possible.

#

and it can take a day depends on your skill to code polished version of such logic

#

Or you can ask ChatGPT probably it is not very hard task for a ChatGPT.

steep warren
molten hill
#

Do not dislike message that can save a day of development 🙂 we are in 2025 it is just a tool (any AI) to speed up development and you should use it in such cases.

steep warren
#

it's consensus to not recommend it in most if not all technical spaces, including this one

molten hill
mossy tendon
#

Hello need help understanding how to assign a material preset to a font asset in textmeshpro
I've created a material preset of the base material my font asset uses but how do I assign it so it can appear in the material preset field?

mossy tendon
#

Figured it out
Didn't realized it had to have the same prefix name for it to work

woven stirrup
#

i was a lil too inspired on Unity's UI

jovial sierra
#

Trying to make regex for ipv4 input validaton. For some reason I can type this in the input field, but when I go on regex101 it doesn't accept. Any idea what the discrepancies are about?

#

It's definitely partially working as I can't type letters or anything

steep warren
#

(solved, apparently)

jovial sierra
#

Well not exactly as I'm still unsure on how to achieve full input validation instead of just character validation

slate sentinel
#

im using horizontal layout in canvas
theres 3 elements the first and third appear correctly but the middle keep spawning in 0,0,0
when i change the sceen like by 1 pixel or changing the rect by any means then it appear correct again
is this me or unity
in the prefab window it appear correctly also but not when spawn in play mode

slate sentinel
#

update its me, i have the content fitter component on the others

steep warren
jovial sierra
#

ig I can use the event for a character being entered and then check the whole string then

orchid vale
#

how can I make the UI sharper and cleaner after importing into Unity? (Image on right is what I am aiming for)

#

like the whites aren't as bright and it doesn't seem as clean looking... idk how to describe it 😛

brisk monolith
mortal robin
#

And change filter mode to Point perhaps

orchid vale
languid canyon
#

i am using 'horizontal layout group' and 'content fitter' to give my text a background. however, the downside of this is that it changes my text position rather than my background. how can i fix this?

mortal robin
mortal robin
languid canyon
orchid vale
#

I see the filter mode but not the compression

#

oh nvm LMAO

mortal robin
#

The layout group on the parent lays out child objects

#

So yes it's going to affect this text object since it's the only child object present

royal locust
#

Does anyone know how I can get a font to render and look good? I've attached my desired effect and the effect I'm getting within Unity with Text Mesh Pro

low pike
spring grove
#

any idea why i might get this row of pixels at the top where the canvas content doesn't render? the graphic for the timer background extends well above where it cuts off here, and other images on the canvas also can't render over it.

#

oh yeah it only happens in 16:10

spring grove
#

or free aspect

vapid edge
#

I can't select my TMP input field, any ideas why? I have it set up to a TMP_Text, I don't have anything obscuring it, it should work?

#

all my other UI elements work

#

I click and it doesn't select, I type and nothing appears

low pike
#
  • something's blocking it -> test this by having ONLY the input field enabled, and as a direct child of the canvas.
  • no active event system
  • it's got raycasting disabled
mortal robin
vapid edge
hushed ether
#

I use Unity on Linux Mint. In the editor everything is fine, but when I use the exported Linux build, my TextMeshProUGUIs do not accept any kind of umlauts or special characters like \ ß ] [ etc. They just don't appear. Anyone knows what could be the problem?

inland obsidian
#

How does a HUD scaling game menu setting work in Unity? Does it scale the scale property of a Canvas. All elements of a canvas? Some hidden Unity property?

low pike
inland obsidian
low pike
#

it would change it on mobile, I can't remember how it acts on a monitor

jovial saffron
#

Hi, how i can make textmeshpro have a backgrounf that expands depending on the message?

fluid sleet
#

@low pike you can see my canves and how some text are off the spot and in the other one the close button is off so is the world chat and private is to the left

#

Had a script to fix my full screen panels for shops and other's but but would like to hear if my canves is wrong and can be fixed so i don't have fix each of them on it's own

low pike
#

you've probably not anchored the misaligned things to the top

#

you've not shared all relevant setup screenshots

#

use screenshots and not photos.

vernal granite
#

hello there
is there a common way to make a dynamic UI grid layout?
I just want to have one container that can be expaned into their parent with a couple tiles inside that auto expand given a fixed row & column count

low pike
#

If the cells don't need to resize, then the grid layout will do you.
If the cells do need to resize.. then.. you either have to write code to update the cell size on the grid layout, or find another solution.

Normally I use nested vertical/ horizontal layoutgroups.. but that's always been for set widths/ scrolling

dusty bobcat
alpine glade
#

how do i make the child to fit it's parent? , i tried using content size fitter and layout group

mortal robin
alpine glade
low pike
#

select the object you want to make fit.
set the anchors points of that object to be correct for the parent.

alpine glade
#

it changes during runtime

low pike
#

what's on content ?

alpine glade
#

textprefab > text

textprefab is for background

mortal robin
alpine glade
mortal robin
alpine glade
#

i disabled both content size fitter and layout group, and set everything in the scrollview object stretch

#

the prefab too

peak ridge
#

Hello, i used a youtube guide to make scrollbar but i've met some problems. Is it possible to set up starter position to component with content size fitter? Every time i launch game it's moving it to the middle. And 2nd problem basically same inability to set up starting position bc if there would be not enough panels then they would group in center instead of being on top of the list

steep warren
peak ridge
#

iirc i've tried to do so and it still moved position to center every time

steep warren
#

are you using the scroll rect layout group

peak ridge
#

My scructure is
gameObject (scroll rect, rect mask 2d) (1 pic)
- gameObject (vertical layout group, content size fitter) (2 pic)
-- panels
- scrollbar

fierce wolf
#

getting this strange issue in text mesh pro (in build)

#

while it supposed to be like this

fierce wolf
low pike
# fierce wolf

show your setup (TMP inspector - inc recttransform) and the code to set this

dusty sequoia
#

the origin is off center how do i make it center?

low pike
# dusty sequoia the origin is off center how do i make it center?

This isn't the 'origin'. It's currently the 'center' of what is selected.. which is the middle of this object and any children.

Some things to change, to work with UI properly.
1- Set the scale back to 1,1,1 - UI scale should always be kept at 1,1,1. If you want to change the size of things, change the width/ height values.
2- Press T to use the UI gizmo tools -> blue circle is the pivot.

dusty sequoia
#

got it tnx

slow stag
#

Outline don't appear in my text mesh pro, please help

modern owl
#

like show the TMP Text settings, show the complete stuff so we can help you

slow stag
#

@modern owl Here is the textmeshpro component settings

#

I downloaded this text from Google Font and use Tmpro Font Asset Creator to create font

#

Here is the shader settings for same font

slow stag
#

@modern owl I put this settings when create font and its work fine now!

cedar spindle
#

Im trying to get a rects world space position for a spawning a visual effect. It does however always end up further down in y. I do have a flexalon layout and a paranet that dynamicly moves up and down and it seems like it doenst take that into account
Does ScreenToWorld actual get the actual world poistion? The rect transform is really small so its not its bounds that are the problem.
Is there any simple work around?

        Vector3 testpos = visualLayers.visualEffectSpawningPlace.position;
        testpos.z =- Camera.main.transform.position.z;
        Vector3 pos = Camera.main.ScreenToWorldPoint(testpos);
        VisualEffectManager.PlayVisualEffect(visualEffectsEnum.cardKill, pos);        
mortal wharf
#

How do I make height match up? I wish there was a way to size proportional to parent (e.g. 50%), would make everything so much easier....

tribal latch
tribal latch
cedar spindle
tribal latch
#

identity rotation?

cedar spindle
#

yes

#

But it might be the problem, I have tried diffrent things, this was to get the intersection a z=0

#

but might be wrong there

#

it si ortographic 2d

#

it is

tribal latch
#

aren't you trying to spawn the effect in front of the camera? usually you'd pass at least nearClipPlane + some tiny delta to avoid frustum culling

#

I assume you tried spawning a simple primitive at the result location to eliminate any issues with the visual effect right?

cedar spindle
#

I actually havent but will do that straight away, just assumed it had to do with the ui

#

Im trying to spawn it on top of an ui element (will have to do a separate camera or something to actually get it to render on top)

tribal latch
#

that's okay, the right render order can be dealt with later. Just make sure it's spawning in the right position first. If you're trying to spawn something on world z = 0 and the camera is oriented facing +z, testpos.z should be the camera z pos since that's the distance from the camera to the origin

cedar spindle
#

Im still a bit confused on how that method works and the documentation doesnt really explain it well enough for me. When just using the camera z (-10) it ended up on -20 with the negative version they end up on 0

tribal latch
#

(x, y) are in screen space. z defines how far in front of the camera the plane that you will be projecting the ray onto will be. If you provide a negative value, this will be behind the camera. By your description, you had the camera at (0, 0, -10) facing +Z, so -10 for the testPos.z would result in the point being projected onto a plane 10 units behind the camera

cedar spindle
#

yes therefore the negation, with pos.z i end up at -20 and with it negated i end up at 0

#

but like i said, i feel kind of supid and confused rearding this so not sure how to handle it

#

and appriciate your help

arctic jewel
#

Im trying to make a pixel 2d UI with a 570x320 image. Its native size is 570x320, its set to that in the image, the camera has pixel perfect camera with 32ppu, the canvas resolution is 570x320 with 32ppu and scale with screen size, yet the logo is too big in game.
I always have a hard time with UI stuff

tulip topaz
#

I'm trying to create my own TMP font with a custom font atlas. I'm so close to finishing, I just need to swap the font atlas texture of this base font with my own. How exactly do I do that? I've heard to replace it using a debug menu but the option doesn't appear when I open the "3 dots" menu in the inspector of the TMP font. How do I do this?

(I don't know if this question is suitable for this category, I hope it is?)

reef cliff
#

Is there a way to keep the pivot at the center of the text when I scale frame of TMP?

proud sandal
wispy vault
#

What is the purpose of the Canvas/Button property "Raycast Target" seeing a lot of mixed discussions on the forms.

mortal robin
#

it will not be interactable if that's not checked

#

I don't think there's any ambiguity around it 🤔

versed cipher
#

Is there a way to hide these TextMeshPro and EventSystem icons? These icons are visible even when the game is running.

mortal robin
#

or turn off those specific gizmos

versed cipher
#

Got it, thanks!

brisk pumice
#

Hey everyone! I’m developing a game like Minecraft for VR devices and am currently stuck at a brick wall: the hotbar and inventory. As a fan of implementing UI elements into the physical game world to increase immersion, I want to create a system that would work for the slots and have an expandable menu or a separate menu that opens into a full inventory. The game has an industrial-revolution type feel to it, so there’s gears and shafts and belts (basically just create mod) to fit with that aesthetic. Anyways, I would love help from anybody or come up with ideas for the inventory. I don’t want something attached to the player’s body for accessibility reasons, especially not a ui panel on their arm. I would prefer something that would be attached to the arm, and expand into a full hotbar, then you could expand that into a full inventory. Thanks!

pearl patio
#

my ui button image sprites are making holes through sprites and acting weird does anyone know a fix for this i cant find anything about this issue online

mortal robin
#

Also noting you're using a special material here

#

What's this shader?

#

Are you sure you should be sharing that?

#

Looks like a paid asset on the asset store

pearl patio
#

idk but i tried different shaders and it has the same issue

mortal robin
#

Certainly I think it's an issue with this shader. The product advertising a UI masking feature

#

Try removing the custom material

#

I also assume the background UI is using that shader too

pearl patio
#

the background ui is sprite renderer sprites default shader

mortal robin
#

do you have any Mask components in the hierarhcy

pearl patio
#

no

#

its an issue because you can see the edges of the image and stuff

#

even though theres nothing

surreal basin
#

Any of y’all know how I should go about getting it so that some of my UI appears in front of players, and some of it appears behind?. I’ve been trying to use Camera stacks with culling masks for each one, but no matter what I seem to do, I can get either the front or back UI to render properly, but never both.

mortal robin
#

you can also use an overlay canvas for the one that appears on top

#

and a SS-C canvas for the one that appears below/behind

surreal basin
mortal robin
surreal basin
#

What's weird is that I don't see the values for setting the canvas type and their plane distance

tribal latch
surreal basin
#

I got it working :)

quartz whale
#

why does the worldspace canvas attached to that pistol move depending on the camera position?

#

it's meant to be directly above the gun

steep warren
#

is your camera in perspective or orthogonal

quartz whale
#

orthographic

mortal robin
#

Definitely looks like a perspective camera issue

quartz whale
#

WAIT

mortal robin
#

you probably have two cameras

#

one for UI

quartz whale
#

i forgot i had an overlay camera for ui

mortal robin
#

yae

steep warren
#

ah, so that's why the other stuff doesn't have perspective lol

quartz whale
#

thanks guys it looks beautiful now 🙂

soft wedge
#

Does anyone know why my pannels dont show Fullscreen after I build my game, even though I have it on Scale with screen size, Its a bit zoomed in

soft wedge
soft wedge
#

I didnt even change their values

mortal robin
#

If you didn't change them, it's likely not anchored properly to be "fullscreen" as you mentioned

mossy spruce
#

Why does this key look weird?
Other icons look normal but this one doesnt
its nothing about the background size. I guess i need to change it from sprite editor and I tried to do it but i couldnt so i need help

mortal robin
#

colors? shape? Something else?

#

how is it supposed to look?

mossy spruce
#

its like fat

#

horizontal

mortal robin
mossy spruce
frigid lava
#

How do i "reset" the UI text? Its staying on all the time XD

mortal robin
frigid lava
#

I still want the UI to work though. Deactiving it just removes it

mortal robin
#

You can reactivate it later as needed.

frigid lava
#

I understand, thanks. I only want the text to appear when i complete the level or when i die.

mortal robin
mossy spruce
mortal robin
#

you can either:

  • temporarily assign a sprite and enable it
  • set the inspector to debug mode and enable it
  • enable it in script
mossy spruce
static ice
#

So is there a reason a UI button might lose its event source like this if the object it's attached to is disabled and then reenabled?

mortal robin
#

Are you sure it's being disabled/enabled and not actually destroyed?

spiral inlet
#

Hello, I have a problem that is hard to explain.

The problem is with Cursor Locked in Starter Asset Third Person. If I click somewhere outside the game window, the UI starts working as it should. Another problem appears—the cursor constantly hangs on the screen, and if we hide the UI and do the same thing, it works too.
Without these cursor manipulations, Cursor Locked does not work, although it is displayed in the inspector.

In short, take a look at the video.

void peak
#

Guys, can I get some help with this? I have a TextMeshProUGUI where I change the text dynamically, but when the text has a <sprite> tag and I switch to new text, the sprite stays on screen, overlapping the updated text. I’ve already tried calling ForceMeshUpdate() after updating the text, but nothing changes, the problem persists. There is a screenshot of what is happening

I'm using Unity 2022.3.21f1 and TextMeshPro v.3.0.9

static ice
viral horizon
#

I have a question on how to make it so when you scale the game window instead of it just showing more of the scene it just up scales the entire window by y axis, heres an illustration of what i mean because im not good with words lol

mortal robin
solemn saddle
#

Hi. I would like to know what's the proper way to organize large-scale UI. Pause menu, Game Over menu, Main menu, Inventory, etc.
Is it adviseable to have multiple canvases, for example? Tips like these would help figure out my problem.

golden stump
#

The unity editor has input boxes where you can click & drag your mouse over the label and it changes the value. It's a nice compact design instead of sliders and I prototyped the same in UGUI. But anyone seen this elsewhere? I don't know if it is a common thing

low pike
#

pretty sure photoshop does it (therefore prob all adobe?), davinci resolve

bronze delta
#

Hey can anyone guide me on creating Glassmorphism UI shader using HLSL?

unkempt pasture
#

Hello i made an UI button but the TMP (child of my button) has a too big transform so i can press my button even if its far from my mouse. does something like raycast target but for TMP exist ??

tribal latch
unkempt pasture
#

ty 🙂

next knot
#

I believe this is the right spot for this...
Why is my image taking the color of the panel?

steep warren
#

check the color on the image, make sure alpha is set all the way to 100, then i guess you'd have to check the image itself

next knot
#

IT WAS THE IMAGE

#

sorry my bad hahaha

gray zodiac
#

Hello, my game is entirely based on UI and I would like to find out how to add this effect in my game that "pixelates" each UI element just a smidge. Can I use shaders to do this? If so, does anyone have any examples of using shaders to do this? Let me know if this isn't the right place to post this.

manic spruce
#

I've successfully added my content code wise to the game under the parent of available cards panel but it's appearing outside of the panel itself, is there a way to make it so the children of the parent are in the visible area of the parent?(green box is my content, the gray box is the area I want it to spawn in)

mortal robin
manic spruce
mortal robin
#

those are not components - those are GameObjects

manic spruce
#

ah my bad

mortal robin
#

Can you show the code you're using to instantiate the card?

manic spruce
#

what's the website to send code?

mortal robin
#

!code

onyx flowerBOT
manic spruce
#

ty

mortal robin
#

Ok so for one, this line can go away:
btn.transform.SetParent(availableCardsPanel);
The parent is already being set in your Instantiate call.

For two - you need to edit the prefab and anchor it properly

mortal robin
#

first off set those to zero.

#

Are you using a layout component in AvailableCardsPanel? e.g. GridLayoutGroup?

manic spruce
#

so if it's a child, it will do an offset that is relative to the parent's location?

mortal robin
#

yes

manic spruce
#

ok, and should I add GridLayoutGroup as a component of AvailableCardsPanel?

mortal robin
#

well let's first start with fixing the prefab

#

and see what that does

manic spruce
#

ok

mortal robin
#

after that yeah you probably want to add a LayoutGroup of some kind to the panel so the cards get laid out automatically

manic spruce
#

it makes it appear now, so that's good

#

but layout group would help for displaying a set of items

mortal robin
#

Yep - you can look up HorizontalLayoutGroup, VerticalLayoutGroup, and GridLayoutGroup

manic spruce
#

yeah I just added it and added a spacing to X, now I can see both cards

#

ty

dim gulch
#

can anyone help me figure out what ui tools i should use im not sure if i should use toolkit or if theres an easy solution for this i want to have panels you can scroll through and open up information about like this

manic spruce
#

How do I make the scrollbar update when the rect has more items to scrollthrough?

mortal robin
#

content size fitter on it perhaps?

manic spruce
#

I'll try that, man I wish I knew all these UI things

#

yeah that fixed it

misty bronze
cinder inlet
#

Hi 🙂 I'm using Unity 6000.1.9f1 and UI Toolkit with a simple button associated to a style which assigns a font to it. While it works well, the font is unassigned from the style when I relaunch the editor.
Has someone ever seen/heard about that behaviour? Thanks

lyric pendant
#

should ui be a seperate prefab or a child of the player...?

hollow sleet
#

Depends on what kinda UI imo