#📲┃ui-ux

1 messages · Page 6 of 1

gleaming viper
#

It's reasonably rounded on the outside, but the button is just not having a good time

#

And the basic outline that comes with Unity is kinda whack as well

mortal robin
#

Use 9 sliced sprites

gleaming viper
low pike
#

I prefer using an asset that gives you control over the shape

low pike
#

What's your actual question

gray bridge
#

when should i use SizeFitter

#

current window

white mist
#

Hey, does anyone know why my Colors are a bit darker in the scene view? (Using URP)

rapid ferry
royal flame
#

I have a Scroll Rect in my game for mobile apps and I've noticed that, on my phone, when I try to scroll faster than a certain value, the speed gets clamped

#

And it doesn't feel very much like a native scroll view would

#

any way to fix this?

fresh marsh
#

How can I export gameObject as image? Or is there any way for me to put a gameObject in a canvas?
I am creating a "how to play" scene. I want to include my power-ups in the canvas to help the player know about the power-ups. However, I don't know how to put a gameObject in a canvas, (I know this won't work but I'm just thinking if there's a way to change some properties of that obejct so I can paste it in my canvas along with the text on it.) I also want to know if I can export a gameObject to a transparent image. Snipping tool is out of the question.

sterile wedge
#

Or... An image UI?

#

Then you can assign the sprite

fresh marsh
#

Gonna try

rugged wolf
#

Why is my vertical layout group modifying the space in-between the child elements of my other vertical layout groups ?

#

I am getting different spacing in-between my text fields even though all the checkmarks that are related to spacing are disabled, this is messing up my layout and I can't seem to figure out why it keeps happening.

rugged wolf
#

solved

knotty ferry
#

Hello. I have a particle system that I want to render particles on top of everything I have on the screen. I have tried creating a camera, with these settings: - Setting the canvas to use that camera, but the particles are really big in size and still do not render on top of the UI. The layers are set correctly. Could someone help me?

dusky canyon
#

why doesnt my canavs show on camera?

placid wasp
#

hi there, I have a 2000x1869 sprite (imported from a png) in Unity. I'd like to use it lower sizes (around 256px) and in its full size. The sprite uses bilinear scaling.
When using a Raw Image in the scene, with the native width and height (2000x1869), it works fine.
When scaling it down by half, the black arcs get aliased.
Again by half, and it's even worse and more ugly
Is there a way to fix this? Mipmaps don't seem to have any effects. here's the image

agile schooner
#

here is the image he is referring to

tight hull
#

Hi
I was reading the TextMesh Pro Unity Documentation
This means that in this box I must set the size in pixels of each character? Sorry for my low english level 😅

#

For example, if I type "7" here, Will each character be 7x7 pixels?

delicate pilot
#

Hello! I am working on creating a computer interface in Unity using UI canvas. I am wondering if it is better to use multiple UI canvas and change the order layer when different screens appear or to use multiple image components. Can someone give me advice on which method is best?

somber mortar
regal hare
#

how do i resize pixel art images? i know there was a way but im not sure which settings do it

obtuse comet
#

Hello ! I have a problem with a UI element that does not show on camera. I've set it in UI and still.

low pike
#

set it in UI
means what?

obtuse comet
#

I've set it in UI

#

Here is an example of an element i want to appear in Camera UI

low pike
#

The layer does not make something be UI

#

You haven't set up any UI by the looks of it

delicate pilot
#

I'm having problems with UI too

#

I want to disable/active screens with event trigger

#

but isn't working

sour marlin
#

Does anyone know why my image isn't showing even though its behaviour has been enabled? When I manually enable and disable it in-game, it works again. Seems like it only works when it starts enabled.

#

code should be fine, since it's just a simple .enabled toggle

#

The reason why I'm doing this instead of enabling/disabling the toggle is because I have OnValueChanged events that I don't want to call.

sterile wedge
night prairie
#

why is my scene grayed out? It looks normal when i start my game

sour marlin
#

My guess is that, because the checkmark image component started out disabled, the canvas treats it as such and doesn't render it properly even when enabled again.

#

No idea how to circumvent that though.

#

I can honestly just turn the alpha to 0 and keep the component enabled.

#

Gonna try if that solves it

#

update: that didn't solve it

sterile wedge
#

Make sure toggle isOn is true

sour marlin
celest echo
#

i have two buttons in a scene that suddenly stopped working. they dont react to hovering or clicking

harsh fox
#

what setting do i need to change to fix this slider? It's stretching instead of filling, but i Don't know what's going wrong.

mortal robin
#

just use a filled image

#

slider is overcomplex and hard to configure

harsh fox
#

well, i fixed it by changing the slider image type to "filled" lol so guess that is the easier way 😅

mortal robin
#

yeah exactly

harsh fox
#

as in "filled image" is the easier option rather than slider lol

mortal robin
#

get rid of the slider itself

#

yea

shy snow
#

Hello, could someone tell me how to stop UI elements from going off-screen? I'm not supposed to use math to align their spawn points am i?

shy snow
#

Will do, i wasn't sure how to go about anchoring since in my case i have issues with pop up menus that spawn on top of objects that are close to edges of the screen

#

learning about anchors was useful but i'm not sure how to use the info to solve the problem i have
here's the problem:

#

you can right click a unit to get a pop up menu, then view cards in the unit's deck and hovering over card previews enables child element with expanded card info

#

i could simply put it lower to avoid this particular problem but is there more dynamic solution?

mortal robin
#

if not, pop it up in a different direction

#

yes this will require you to write some code

shy snow
#

right, that's exactly what i wanted to do

#

idm writing code, this entire project is gameplay prototype + me trying to learn my way around UI

#

i guess i know where to start now

shy snow
ashen robin
#

hey for some reason I cannot scale/manip. canvas can someone help?

mortal robin
#

you cannot resize or manipulate the canvas

ashen robin
mortal robin
#

the idea is it matches your game window

mortal robin
#

you can do whatever you want with that

ashen robin
mortal robin
#

and set the resolution of the game window to your phone resolution

#

that's the point of it

#

(i.e. take it off "Free Aspect")

ashen robin
mortal robin
#

Set to whatever resolution you want

ashen robin
harsh fox
#

very vague question...but what do you think this UI missing? Here it is in 1080p and 4k (with some dialogue)

Or is this enough? I was thinking hotkeys or a minimap, but I can't think of a use for hotkeys in the game since it's mainly dialogue and set collection. Or maybe even a keybind reminder? (WASD, E to interact, etc.)?

#

gameplay is top down 2D pixel RPG, hence the inspiration from stardew valley for the UI 😅

mortal robin
#

I wouldn't add anything unless you have a compelling gameplay need

lyric kite
#

must add cruelty squad ui border 👍

reef stirrup
#

Hello There. Does any of you struggled with overlapping score? If that's not correct channel, sorry about that. I'm quite new in here, happy to fix it! 🙂

harsh fox
harsh fox
ebon iris
#

Someone here who is good with unity UI? I try to make a simple grid layout group where the background scale with the amount of gameobjects inside the group. But I cant get it working?

I tried everything with different combinations of UI elements but its not working and google couldn't help me too.

low pike
#

content size fitter on the grid layout, with the image component also on that same gameobject

ebon iris
thorn peak
#

Does anyone know why this text will not go above the grounds and all?

mortal robin
#

Also whhy use legacy TextMesh when TextMeshPro exists?

sharp oracle
thorn peak
#

Yeah i did

#

it doesnt matter what z possition i put it

sharp oracle
thorn peak
#

it will stay behind everything else

sharp oracle
mortal robin
#

probably some kind of render queue thing then

thorn peak
mortal robin
#

move it in front?

thorn peak
#

its infront

mortal robin
#

doesn't look that way 🤔

shy wedge
#

A 2020.3 project that I have been given already has some third party 3D assets. How can I check their (I apologise for not knowing the proper term) 'quality' so if I were to introduce other external assets they look as real as each other?

reef stirrup
wraith copper
#

hello may anyone answer me why my button is blurry I am a begginer

frosty pewter
#

You should use the Text Mesh Pro versions of controls, not the legacy text. Legacy text isn't good

#

TMP uses signed distance fields to draw text, which are sharp at any distance

wraith copper
#

okay i tried it out but it's kinda wrecked xD

#

okay i fixed it tysm :))

wraith copper
#

I'm having problems with my button not working - I haven't even gotten into the point of scripting it and it's not even clickable

wraith copper
#

still doesnt work

#

is there anything i can screenshot and send ?

tiny whale
#

In code, I have the enemy prefab always face a target, but I dont want the ui attached to the enemy to also face it. How could I have the ui canvas always face the camera while the enemy faces the target?

#

Also, is this the right channel for this question?

reef cloud
#

hey there, wondering why TMPro is giving me this error on trying to build? i dont know if it has to deal with a custom font or not, but that's what it's hinting towards

frosty pewter
cinder mica
#

Does anyone have an idea why the TMP in my button is ten pixels closer to the right side than the left? The text is center aligned and all paddings and margin settings I can find are set to 0, I have no idea why this is happening. It looks terrible when the button is activated

wild pebble
empty cobalt
#

Hye; is there any other way to build the ui for unity game other than in unity itself, like use of figma , adobe XD etc.. is it actually recommended to make ui in unity ?
tell me, do ping me--

low pike
#

Depends.

If you're making a mobile app, with the app built in native (which then runs the Unity build within) then use whatever UI solution you would for native.

#

If it's just Unity, then I've never seen a way to do it outside of Unity

opal kernel
#

Anyone here familiar with Localization package?
I can't quite understand how to properly use global variables.

            // You would normally set this up through the Localization Settings Editor, however
            // we do it here for the sample so that it can work without any changes to the project.

sample says this, but...
I literally can't find how to set it up in editor anywhere

#

Localization Settings asset does not contain any variable group fields

rapid ferry
#

i want to change the properties of a UI material at runtime, but i want to only affect that UI element instead of all of them, is that possible or is there a limitation on that?
i'm able to do this with sprites but when i try to do the same with UI elements it changes the main material and affects everything

mortal robin
rapid ferry
#

oh bet didn't know you could do that ty

iron horizon
#

How to put image overtop ui elements?

muted shuttle
#

I have used this icon with transparent background, why there is this line above "lock icon", and how can I rid off this line

iron horizon
#

i cant put a ui image over a ui button from another canvas

celest echo
#

I want to build a deathscreen where the highscore and the amount of enemies killed (for multiple types) as well as a sprite of the enemies move to a specific location. I also want to make the elements move back to their original positions when the player clicks on try again for example. Whats the best way do achieve this?

chilly sorrel
#

By any chance, could it be that some elements can't be put into canvas? I've got a Mapbox map that I'm trying to bring into a canvas, which works first, but when I save the project file and start it up again, it didn't save the position and rotation. It's still a child of the canvas, but the positioning isn't saved.

unkempt vortex
ebon fiber
#

why i get the whole pro text ui displayed?

sterile wedge
ebon fiber
#
{
    [SerializeField] TMP_Text scoreText;
    public static int score = 0;

    [SerializeField] TMP_Text liveText;
    public static int lives = 0;

    private void Update()
    {
        scoreText.text = $"{scoreText}: {score}";
        liveText.text = $"{liveText}: {lives}";
    }
}
sterile wedge
#

what did you expect it to look like?

ebon fiber
#

it is a string, right?

sterile wedge
#

no, it's a TMP_Text

#

what did you expect it to look like

ebon fiber
#

yes i stored it as one

sterile wedge
#

what did you expect the text to look like

ebon fiber
#

score: 0

#

lives: 0

sterile wedge
#

then just put scoreText.text = $"score: {score}";

#

you dont need to print your scoreText variable, so why put that in the string?

ebon fiber
#

ah

#

thank you

vast fern
#

I've just started working on a customization UI, and I'm about to add color options for skin, eyes, hair, etc etc.

When you click one of the buttons (head, hair, eyebrows, facial hair) the row of options appear.

Where would you initially place the color options?
Have them always displayed in its own section?`
Have only hair color displayed if hair color button is active, etc

limpid plinth
#

Hello first time Poster and kinda lost about which channel to use but I think this might be the correct one. So I'm using unity 2022.2.1f1 and I'm trying to make a model show up in my Ui. I've got it working with render textures however following other tutorials I couldn't get it to work with transparent background. (using hdrp) since I wanted to make the 3d model itneractable anyway (to make a turntable kind of thing) I was thinking about switching to using a 3d model. Checking out some tutorials online I figured out that this is only possible if the canvas render mode is set to screen space - camera and using an extra camera for it. However im running into the problem of the Ui showing up in the editor but not in the actual game and I'm a bit lost on what to actually do (same happened for the model before I changed the render mode so I'm guessing I'm doing something wrong)

low pike
brazen sphinx
#

Localization Settings asset does not

celest lodge
#

why are the guns blacked out? and why dont they show up in the playtester?

clever imp
#

showing your hierarchy panel in the same time shall greatly help

celest lodge
#

i figured out the issue

#

sorry it was kinda easy lmao

#

okay no i didnt

celest lodge
#

i fixed the lighting issue but idk why it doesn tshow up in the thing

#

playtest

#

UI is the canvas

#

the objects have animator components

mortal robin
#

What components do they have?

#

Make sure they have ui Image components.
NOT SpriteRenderer

celest lodge
#

is it possible to animate ui components with a sprite renderer though?

#

i mean

#

image

#

component

mortal robin
#

sure

#

why not

limpid plinth
celest lodge
#

idk i thought it was only for sprites

mortal robin
#

The Animator is for everything

#

its the same one used for 3D models you know

#

It just animates data, it doesn't care too much what that data is.

#

What kind of animations are you doing anyway?

celest lodge
#

just switching between different gun images

#

its for a loadout viewer

mortal robin
celest lodge
#

how would you do it?

mortal robin
#
myImage.sprite = whicheverSprite;```
celest lodge
#

i mean i guess

#

i thought an animator would be a bit easier but

mortal robin
#

That's all the animator is doing ultimately

celest lodge
#

i guess it makes more sense

celest lodge
mortal robin
celest lodge
#

thanks

#

whats the difference between UI and elements?

mortal robin
#

Which is a different UI system

celest lodge
#

ah okay

#

thank you

ionic saffron
#

How do I add a border to a gameobject?

#

I tried using Outline but it didn't even show

low pike
low pike
low pike
#

I still don't know what this is

#

you didn't show the inspector

ionic saffron
low pike
#

is it a primitive cube? a sprite renderer? a UI image?

ionic saffron
#

sorry I'm kinda new

#

so

low pike
#

right, that's not UI so not for this chan 😉

Ask in #🔀┃art-asset-workflow - I've not worked with 2D, I dunno if Unity has a built in way to put an outline on something. I would just do it in PS

nimble ember
#

so i have a tmp_text

#

on a canvas set to screen-space camera

#

the text is clipping through objects - how would i sort the text to always be rendered above?

mortal robin
#

Or reduce the plane distance until it's closer than any objects

nimble ember
#

Reducing plane distance would make me have to reposition everything else on the canvas

nimble ember
#

actually wait nvm, i was wrong

#

it worked fine, thanks :D

stuck crow
#

Is there any way to set the cursor to the windows pointer?

tall oak
#

hi, I've tried to use OnPointerEnter and OnPointerExit on a 3D object, so I have an Event SYstem game object with Standalon Input Module and Event System component, I also have the Physics Raycaster on my main camera, and I have this script attached to the game object where I want to use OnPointerEnter and OnPointerExit :

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

public class LaptopScript : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
    public TextMeshProUGUI onPointerText;

    void Start()
    {
        onPointerText.gameObject.SetActive(false);
    }

    public void OnPointerEnter(PointerEventData eventData)
    {
        onPointerText.gameObject.SetActive(true);
        Debug.Log("Pointer entered Laptop");
    }
    
    public void OnPointerExit(PointerEventData eventData)
    {
        onPointerText.gameObject.SetActive(false);
        Debug.Log("Pointer exited Laptop");
    }
}

But it doesn't work at all, I don't know why, if someone knows, I would be very happy to know what I miss :)

sterile wedge
#

You can look at game UI database
It's a site. Can look there for inspiration

whole monolith
#

please someone explain to me how i am supposed to get the reference

viscid juniper
#

^^ I fixed it by changing Canvas scaler to Match width and height and setting value to 1

sterile wedge
#

Are you sure nothing is blocking the object? Look in the bottom of the inspector of the EventSystem to see what your pointer is actually on?

tall oak
digital dragon
sterile wedge
#

How about checking the EventSystem?

tall oak
tall oak
digital dragon
#

Play the project --> Go to inspector and click on the event system --> Open the bottom tab (You need to drag it up) --> Try to interact with the object and check if it's detected

digital dragon
tall oak
sterile wedge
#

Disabling the canvas disables the graphics raycaster

tall oak
digital dragon
sterile wedge
#

Yeah, I meant that

copper ocean
#

can i change * to anything like big dots ?

#

i am using textmeshpro

sterile wedge
copper ocean
raven stag
#

hey! i have a tmp text object inside of a scroll view. I am adding text to the text object every 0.5 seconds. how would I be able to have it so that the text object automatically scrolls so that the bottom line of text is at the bottom of the scroll view? or how could i do this without a scrollview? the scroll view isnt really necessary for me, thats just the way I thought of doing this.

sterile wedge
#

it's the simplest way I can think of, without asking for more context or actually testing

raven stag
#

i tried that but it doesnt seem to work. ill keep playing with it. thanks

sterile wedge
#

a video would be clearer, with the inspector of the text and scroll view shown as well

low pike
#

Does the content for the scroll view have a content size fitter on it, and set to resize with children? If not, then it won't scroll with additional text because it's already at its limit

grim fog
#

How do you change the alignment of a texture image on a handles label?

#

I keep getting the issue of the texture rendering with the top left at the center

mortal robin
plucky whale
#

question

#

someone knows how to make an Canvas animation to

#

not... slide?

#

like, it starts slow, then fast, then slow again

#

(im animating a fog cloud, that moves to left to right, and im changing the X position)

mortal robin
#

with some kind of easing function

#

You'd have to explain your setup for this animation

plucky whale
#

@mortal robin wanna go voice chat?

#

i can stream and show you

mortal robin
#

no

plucky whale
#

oquei :c

waxen matrix
#

Hi I don't really understand content size fitter. Preferred size especially doesn't make any sense to me, it seems to base the "preferred" on what size the original sprite was, how can I get my UI object to start at a specific size?

flat ibex
near folio
#

Is there a general recommendation on which of these two methods you should use for opening/closing a UI screen (such as a pause menu, inventory, etc.)?

  1. Instantiate a prefab of the UI screen to open it, and then destroy that instance to close it.
  2. Embed the UI screen in the scene, but have it default to be inactive. Activate the object to open the screen, and deactivate it to close the screen.

I've used both methods, but I haven't worked with UI enough to have a strong opinion one way or the other.

mortal robin
whole monolith
rapid ferry
#

hey, can i ask you guys smth ?
i am making a Drag and Drop workflow (or screen idk), but i dont know how to make it ( maybe scroll ui ) ?, it may be procedual generation (bc its width and heght maybe infinite), btw i need help to make a grid like this too (and when u scroll u zoom in instead, u hold middle mouse u Pan the workflow) (u guys just have to explain, dont share ur own srcript)

(sorry for my english)
(sorry the vid sucks too)

#

(or diagrams sorry)

ionic saffron
#

how do I add rounded corners to a Panel?

#

(2D)

low pike
#

Either buy an asset from the asset store that allows you to generate sprites in the editor, or create a sprite in an art application (eg: Photoshop) and import it

#

This being the UI channel, the first suggestion is for UI assets..

rapid ferry
#

what the

#

how about my problem 😦

jagged monolith
#

Search for infinite scroll @rapid ferry, that's the commonly used term

rapid ferry
tacit yoke
#

Hey folks, a little brainstorming here, what are the common reasons a Button is not interactable ?

mortal robin
tacit yoke
mortal robin
#

as mentioned

tacit yoke
#

oh yeah you mentionned it sorry 😮

plucky whale
#

question

#

is it normal to a menu to have 2+ canvas?

#

or i am being a weirdo?

mild kernel
#

It's not weird

storm adder
#

is it possible to render text onto a ui image without having a text object there

#

like the only object in the hierarchy would be the image with a script on it that renders a bunch of characters onto the image

rapid ferry
#

hey i got a slider ( which has the value (of the handle) from 0 to 1) , but i wanna make the thing at the corner follow the slider too (which has Vector 2 (i guess) transform), pls help me, for my english

mortal robin
storm adder
mortal robin
storm adder
#

thanks for the confirmation!

sharp oracle
#

I have a Scrollview with buttons in it. Whenever you try to click anywhere other than the dead center of the viewport, it just scrolls the rect and doesn't click the button. Is there a way I can either disable the click-and-drag scrolling or find some other way to make a UI button work properly inside of a Scrollview?

mortal robin
sharp oracle
tulip verge
#

Has anyone here got emojis working with the new version of TM Pro?

#

I'm trying to follow the docs but I don't even have the option for creating a "Color" font asset

#

Did you ever get emojis to work?

mortal robin
tulip verge
#

Right click in the Asset folder, and then select Create > TextMeshPro > FontAsset > Color. This ensures that you create the font asset with the right shader (Sprite) and the right atlas rendering mode (Color).

#

^ that is what the docs say

#

When I go to Create > TextMeshPro > FontAsset > there is no color option

#

I tried in both 2020.3 and 2021.3

#

I have TM Pro 3.2.0-pre.4 installed

gusty igloo
#

I believe in the font asset creator you can set the renderer or whatever to color

#

At this point I'm not sure where I'm failing so I sort of just gave up lol

tulip verge
gusty igloo
#

It's very weird there's literally zero documentation or tutorials on it, I feel like it wouldn't be too uncommon of a use-case

ashen robin
#

hey just checking this will make the main menu disappear and popup the new UI correct?

mortal robin
#

that is all

ashen robin
ashen robin
# mortal robin huh?

Ok so I’m making a Vr game and I am making a phone spawn in your hand if you position it at a certain angle

mortal robin
ashen robin
#

will this work

mortal robin
#

The top one will do nothing, since you have it "Off"
The bottom one will deactivate the Main Menu in the editor and at runtime

crimson steppe
#

Hi everyone. I'm trying to make a panel in which dialogue should be shown, but I'm struggling to get something right. I'm using a parent object with a vertical layout group, with a child background object with a horizontal layout group. The background object has two children: Name and DialogueText. Both will be filled with the correct strings by script on activation.

What I want is to sort of give the Name a width priority so that DialogueText can only stretch so far and wont actually squeeze Name into being smaller. Is this possible? Thanks for any tips in advance.

#

I already tried messing with Auto Size and enabling/disabling Wrapping in the DialogueText and Name objects. I also can't really use min/preferred size option as Name and DialogueText are variable, because when a long name is entered it'll move the last letters on the next line anyway.

#

I want to sort of give Name priority in sizing. For example, when someone has a long name like Christopher or something, It'll stretch and push DialogueText away, but DialogueText shouldnt be able to stretch and squeeze Name.

crimson steppe
#

Nevermind I've moved on to another idea.

nimble ember
#

i have a bunch of tmp_text objects on a canvas

#

none of them are showing

#

except for a square symbol in one

#

none of the vertex colors are transparent

#

an image on the canvas is visible, so probably not an issue with the canvas

#

wondering what could be causing this

crimson steppe
#

send pic of what you're seeing and some of your TMP component settings

nimble ember
low pike
#

select the TMP object, then show a screenshot of the entire editor so we can see the hierarchy, the scene view and the inspector

#

also, side note, BoxCollider2D is for sprite renderers.. not UI

nimble ember
#

fixed it, it was a weird dilation on the text material

nimble ember
#

on hover specifically

nimble ember
#

thanks 🙏

tropic umbra
#

I want to build a UI element that's like a small social media post, it has a profile pic, username "x minutes ago" and can contain an image optionally.
truth is I suck at UI design, are there any templates that could get me started?

lone slate
#

anyone know if there’s .guiskins anywhere on the internet that make IMGUI look better? imgui is super useful for game jams but it’s just so ugly

tropic umbra
#

how do I take a sequence of separate pngs or an animated gif and turn into an animated sprite in unity

#

everytime i try dragging them all into the scene tocreate an anim it creates an anim with a "sprite renderer" not an "Image"

#

nvm i did every frame by hand

rapid yew
#

how to render particles in front of the canvas

red harness
#

is there a reason why the button in my game isnt working?

#

its not even showing that my mouse is hovering over it

mortal robin
rapid ferry
#

why is a canvas so separate from the actual scene/camera? how would i light UI?

mortal robin
vast fern
#

I'm currently re-making my Customization ui, and I need some suggestions

#

What kind of layout would YOU prefer? make the left box a bit bigger and add Male/Female on top?

#

The numbers are each option for a picket category, this will be displayed in a box somewhere, probably under the other options

#

It's an RPG game, so I might add the option for some traits, so maybe have a longer bar at top with "Gender, Apperance, Traits, Skills" etc

crimson steppe
# vast fern

I'd make the colors smaller and make them sit in the top right of the screen but thats just my personal preference. the way it is now it feels like it takes up almost your entire view.

low pike
#

@ionic saffron TMP has a non-UI component so you can have text in 3d space without a canvas

vast fern
#

the numbers on left are the different options in the category selected. I was thinking of having only the colors relevant for what category you clicked on be available, if you get what i mean

crimson steppe
# vast fern

color grids still too big for me. appearance/traits/skills too big. male/female etc looks fine

#

and maybe accept button in the middle below the character

#

again this is just my preference

vast fern
vast fern
#

Appreciate the feedback!

crimson steppe
#

yw gl

#

and yeah i like option 2 more with the numbers thing inside male/female thing more

#

together with head hair eyebrows facial hair

vast fern
#

Colors are the bottom will be color options for the different categories, as the player click on them

#

Anything you hate about it?

red harness
wintry wolf
#

Adding keyboard/gamepad support has been very tedious and long process

timid nymph
#

how do I use a png image for this

old cape
timid nymph
#

ok thanks

rapid ferry
#

i made an empty and attached some sprites to it and then added a horizontal layout group but its not working, why is that?

jagged monolith
jagged monolith
#

Sprites are not UI

#

Actually you don't even have this on a canvas

#

The layout group only work on canvases and UI images

rapid ferry
#

o

#

thanks for the info

strong bone
#

Hi I just exported my unity 3d game to my phone and the canvas is much smaller than how it looked on pc

sterile wedge
#

and set the correct reference resolution, which is the one you were using in the editor

low pike
#

Use the device simulator in the editor, not the game view

deft vigil
#

my game looks fine in this mode but when builded it looks all weird

deft vigil
#

and how can I change my game scale to 1

mild kernel
#

That has nothing to do with UI or game scale. There's rarely a need to move that slider away from the far left.

quartz whale
#

I've made these options and they both work, but for some reason only one at a time depending on which one is in front

#

I can't figure out what's causing it

#

if i move the volume option down on the hierarchy i can adjust the volume, but i cant change the graphics settings

#

and vice versa

thorn peak
#

Does anyone know why i cant clikc on the button listed on the left of the box ?
I added setactive false to it, but it doesnt do anything when i click it, like i cant click it at all,

When i settrue or setfalse with cute it does work,
But the button seems not clickable

quartz whale
ionic saffron
#

I'm having issues with adding a text on a prefab.

#

Once I add a text, a canvas is automatically added.
When I go into the game, I do not see the text

#

even when I change the position to the camera area

#

I can only see it in the Scene

#

I cannot see it in the game

#

I am guessing Canvas is pretty much screwing the text

#

is there a way to add a text without a canvas?

#

Nevermind

#

I found a solution

#

Create a GameObject + add TextMesh component

hearty mulch
#

how do i make it so i can click these worldspace canvas buttons

rapid ferry
hearty mulch
#

alright ill try that

#

i don't see the button for that @rapid ferry

#

i might be blind but i don't see it

rapid ferry
#

I havent used tmp before only text

#

you can try to disable the TMP then try to click

#

just to be sure that it is the problem

#

clear the objects that blocks the buttons, then try

hearty mulch
#

the button already has this btw

#

i just deleted the tmp and it still doesn't go dark when i hover over it

rapid ferry
#

Wierd, I had to change my canvas to world space, should work fine

rapid ferry
hearty mulch
#

well im probably missing something obvious

rapid ferry
#

can you show your heirarchy?

hearty mulch
#

ill try adding some more events and see if that works

rapid ferry
#

if your button isnt under canvas, obviously it wouldnt work

hearty mulch
#

out of curiosity, why?

#

hold the phone

#

if its not under canvas, it would work?

#

is that a typo or an actual fact

rapid ferry
#

typo haha

hearty mulch
#

ok i was gonna say

#

that would explain a lot

#

fyi i know like, probably nothing about ui

#

the most i've done before is a main menu

rapid ferry
#

have you fixed it?

hearty mulch
#

im currently trying to debug

#

@rapid ferry i reckon its probably very simple

#

is it possible to click UI when the cursor is locked?

rapid ferry
hearty mulch
#

that makes sense

#

what if the cursor is hidden

rapid ferry
hearty mulch
#

well im completely lost then

#

is this code broken or something

rapid ferry
#

you really should try to make that button work while cursor is visble first

hearty mulch
#

yeah i did that

#

well, i mean, im trying to do that

rapid ferry
hearty mulch
#

it is

rapid ferry
hearty mulch
#

this is so confusing

#

theres no errors

#

or anything

#

it just simply does not click

rapid ferry
#

can I see the button in editor?

hearty mulch
#

have the whole screen

rapid ferry
#

canvas looks fine

rapid ferry
rapid ferry
hearty mulch
#

what does this mean lmao

rapid ferry
#

click on the button and add a OnButtonPress event

#

then find EventSystems

#

add your script the pay thingy

rapid ferry
hearty mulch
#

i have added an onbuttonpress event

rapid ferry
hearty mulch
#

yeah lol

rapid ferry
#

and where is this script in the explorer

hearty mulch
#

is this not what i need

rapid ferry
#

bro why the script not in EventSystems

#

why in text

rapid ferry
#

yes but when you make a gui

#

it creates a event system

hearty mulch
#

so, do i put the script in the eventsystem instead?

#

is that the problem

rapid ferry
#

yeah test that

ionic beacon
#

no

#

The method can be on any object

hearty mulch
#

ok so that did nothing

#

im glad i did that lol

#

well, im starting to run out of options

rapid ferry
#

anyway you should try that

hearty mulch
#

there is no way that this worldspace ui just don't work

#

what do i do

#

i don't wanna convert it to boring ui

#

ok well it works as screen overlay @rapid ferry

#

but i want it to be worldspace so what do i do lmao

#

this is communism smh my head

rapid ferry
#

I suspectsomething is blocking the mouse along the way

#

do you have other canvas

hearty mulch
#

ooh

#

i might

rapid ferry
#

disable that whoever that is

hearty mulch
rapid ferry
#

set a method that will turn that off when not needed

hearty mulch
#

right...

#

i know what that means

#

mmhm

#

im such a good game dev

rapid ferry
#

or whatever is in the center

#

turn off the raycast target

#

if you have panels, image, text, or any ui element that blocks the center, turn that raycast off

hearty mulch
#

but how

rapid ferry
#

look at that canvas, then click the center

#

you should be able to hit something

hearty mulch
#

there is nothing in the canvas

rapid ferry
#

then delete it lol

#

why even keep an empty canvas

hearty mulch
#

it causes errors

#

because some code refers to it

#

i can delete it

#

big brains

#

@rapid ferry i deleted the canvas and it still doesn't work soooo

hearty mulch
#

this is literally 1984

sterile wedge
#

your Canvas object needs a Graphics Raycaster component as well, if that's the issue @hearty mulch

hearty mulch
#

@sterile wedge it has one

#

already#

sterile wedge
#

okay. I dont actually know the issue you were running into

hearty mulch
#

its worldspace ui, a button to be specific, but i can't click it

#

it doesn't go dark when my mouse is over it, it doesn't fire an event when i click it, you know

#

no errors in the code, just literally does not work

sterile wedge
#

can you show the current inspector of the canvas? @hearty mulch

hearty mulch
#

@sterile wedge it looks fine to me but im very lost

sterile wedge
#

that's the hierarchy

hearty mulch
#

@sterile wedge is this good

sterile wedge
#

yeah

#

and what's the object you want to detect a click on?

#

show me its inspector

#

i have to go

hearty mulch
#

there you go

hearty mulch
sterile wedge
#

hmm.. afraid at first glance I can't see what's wrong. I dont work with world space canvases much either. Hope you figure it out

hearty mulch
rapid ferry
hearty mulch
#

but how would i do that if its not worldspace

rapid ferry
hearty mulch
#

precisely

#

so i have no option but to make it worldspace

hearty mulch
rapid ferry
#

when choice appear unlock your mouse, then when you select option, lock it again

#

you can even use OnEnable and OnDisable for it

hearty mulch
#

with the context, that would not work @rapid ferry

#

its ok, i have a new system

fading fractal
#

For my ground material im using a texture in albedo and the same texture in detail albedo for secondary map. I shift them by x & y and get enough randomness for my game.
The problem here is when layering both textures above the main color heavily changes. Is there a way to keep orginal color when layering ?

cosmic mantle
#

How do I ensure that one element of a menu I have is in front of all the other elements of it? Some of the elements are ones I'm generating by script so when they are created they are generated in front of an element that I would like in the front.

mild kernel
#

Set it as the last child, the order of objects in the hierarchy determine the draw order for UI.

cosmic mantle
#

So just access it in script and object.SetAsLastSibling()?

stable oyster
#

What is a good way of setting up panels like this in game? Are the things on the sides and bottom ui elements? Seems like it is because of its interactability, but I also dont want it to be in front of other things, I just want it to be its own area.

inland lava
#

hi guys, trying to create a tooltip but struggling to get the background to auto size and also get everything aligned, im sure this is something someone has done before, anyone provide some guidance please?

ripe crater
#

hello
I have a problem with content size fitter.
Why isn't the component resizing the object to encapsulate the children?
It works if it has a layout group, but I need the case without it.

here is the image of the problem
the parent should have red bounds, but it is 0, 0

ripe crater
#

hello

sturdy zodiac
#

can someone help me with my ui? its blurry for some reason im not sure why

mild kernel
#

Use TextMeshPro instead

sturdy zodiac
#

im trying but its so goofy

rapid ferry
#

How to make these options stick more to the center?

devout crypt
#

hi, I'm working on setting up a settings menu right now, and for some reason the sliders for volume, sensitivity, etc, and the sliders change color when I click them, but I can't drag them at all. Any ideas?

#

for reference, they are part of a horizontal layout group inside a scroll rect

#

toggles, dropdowns, etc. all work

mortal robin
rapid ferry
#

ahh working now

#

That was very quick fix, thanks! I havent really messed with layout groups before

zenith mulch
#

My TextMeshPro-Text ist above Elements it should be behind.
Sorting options, Z-positions all fine according to the topics i found. Shader is not the OverlayOne.

Which part am i missing?

sour walrus
#

I'm trying to make UI that displays in-game time, so far i have this but when i click play it doesn't show up?

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

public class Clock : MonoBehaviour

{
[SerializeField] TextMeshProUGUI clockText;

private void Update()
{
    clockText.text = System.DateTime.Now.ToString("HH:mm:ss");
}

}

hexed dagger
sour walrus
#

srry thats and old screen shot

#

it is now

#

wait nvm i just had to restart

pliant kettle
#

I want to do something like this but like as shown in the bottom picture when i add another it adds it to the right

#

@gentle iron they were talking to me not u

cyan sentinel
gentle iron
#

ah-

cyan sentinel
pliant kettle
#

positioning rn i dont have any progress bcs i gotta lotta crap to do before i get there

#

i just wanna learn how to do it

#

i can make a mock up

cyan sentinel
#

I suggest looking into the unity learn tutorials about UI for example. Alos reading the docs about layout groups. And if you want to have sorting, you can use lists or the sibling index of items in UI

pliant kettle
#

hmm ok lemme explain exactly what i wanna do

#

so im making an rts game where i can highlight select things obv like a normal rts game, and when i have multiple things selected of diferent types like a building and a unit I want to show the ammount of each of them i have selected

#

pain i gotta go to bed now gn

ashen trellis
#

So I have a problem

#

Text doesn't show up

#

I don't see an option to add text

azure flame
#

Use TextMeshPro version. Old text you can find in Legacy menu.

ashen trellis
azure flame
#

Not sure what you are trying to show. You have Text-TextMeshPro right there

#

and if you look under those options you will find Legacy components

ashen trellis
azure flame
#

No. Old text uses huge atlases if you resize something and TMP is compact SDF fields.

iron horizon
#

Button not working for some random reason

#

My other buttons work perfectly fine

#

NVM JUST redid it and it worked

slender pasture
#

in the editor this ui image has a transparent backround but it isnt transparent in the game view. why is this happening and how would i fix this?

mortal robin
#

is this a UI image component?
What are the import settings for the image?

slender pasture
#

its an raw image component

mortal robin
#

why not use Image

#

also why are you using some weird material

slender pasture
#

well neither image nor raw image worked

#

and the material is transparent, but the transparency isnt showing up on the ui in the game view

low pike
#

does it have its own camera?

slender pasture
#

i fixed it by changing the canvas render mode to screen space and using the camera

zenith mulch
mortal robin
#

just a basic Image component with the default material would work fine

low pike
#

The image shared is tiny and impossible to understand what's going on

zenith mulch
ionic saffron
#

How do I anchor buttons?

#

As in keep their position static/stable

ionic saffron
#

nvm figured it out

rapid ferry
#

i used a deselect event trigger on a button which only works when i press any other button, how do i make it so that deselect event trigger works when i stop pressing the button?

mortal robin
rapid ferry
#

nvm i just used pointer up and down and it works now

dense crystal
#

Anyone able to tell me how I might be able to get this tiled scrolling background I made to only be visible within the heal bar's background -- for example a mask?

#

My assumption would be that I can use a sprite as the 'area' that will contain the texture

coarse anvil
shrewd egret
#

I'm using text mesh pro and after looking here : https://forum.unity.com/threads/change-color-of-a-single-word.538706/
And here
http://digitalnativestudios.com/textmeshpro/docs/rich-text/#color

I came up with this:
_calandarDateText.SetText($"{"W" + _playerData.CurrentWeek }" + $"{"<color=#FF0000>/D" +_playerData.CurrentDay.ToString() + "</color>"}");

and when I open it in the inspector in game I see the text field of the component change to W1<color=#FF0000>/D1</color> but for some reason the second half isn't red...

Anyone shed a little light on this?

#

I think it's because I'm using a font file? but I don't know why that would stop the tags from working

#

it is a tmp_pro font asset

bright plover
#

Hey yall couldnt find the "right" channel but i think this is the closest. I am wanting to make a "card" but it has a weird shape (see attachment) How would i go about making a card take that image without the white? i tried making a 3d object the shape of the card and applying it as a texture but the texture splits into 4.

mild kernel
#

Do you want the card to be 3D or UI?

#

If 3D, you'll need to model it to the same dimensions (or proportional), then UV it to use that image as the texture. You can project it directly down onto the mesh and manually align it.

frigid scaffold
#

Hey folks - just posted this to the Unity forums, but thought might be relevant here - I've been working on a free, open source Figma importer and just released

hearty mulch
#

is this the right place for questions about post processing?

hearty mulch
#

oh lmao

#

i didn't see that

rapid ferry
#

why is my canvas visible in the game view?

mortal robin
rapid ferry
mortal robin
rapid ferry
hexed pumice
#

Does anyone know why these text are shown in the editor and small game preview but when I go maximized they disappear?

hexed pumice
#

Same thing happening with my main menu

gleaming viper
#

Quick question, there's no reason to use Legacy Text right?

#

So you should always use TMP?

gleaming viper
#

(If you do, probably don't?)

azure flame
gleaming viper
#

Thought so, thanks

gleaming viper
#

GetPrefferedValues doesn't seem to do anything? It has worked before with single lines/words but apparently it doesn't like a whole paragraph? Anyone ideas on how to solve this?

using TMPro;
using UnityEngine;

public class GetPref : MonoBehaviour
{
    [ContextMenu(nameof(Start))]
    private void Start()
    {
        TextMeshProUGUI text = GetComponent<TextMeshProUGUI>();
        text.GetPreferredValues(text.text);
        print($"{nameof(Start)} has been run");
    }
}
gleaming viper
#

(And no errors)

gleaming viper
#

(Please @ me if you respond)

azure flame
#

My usual go to when I try to do more advanced stuff with TMP is the original tutorial collection on YouTube, I think it is listed in the manual on asset main page too.

mortal robin
zenith mulch
#

My text looks good in game but really crappy in editor.
Anyone got an idea?
I had to reinstall my PC and switched from 2022.2.1f (?) to 2022.2.5f1

zenith mulch
#

Okay, i reinstalled the TextMeshPro-Ressouces. Now my text that has no outline configured has an outline.

dreamy warren
#

how do i change scroll bar scroll speed for dropdown

rocky holly
#

Since I have moved this question several times, I will just post the message link here. I am hoping for someone familiar with scrollbars and content size fitters to be able to provide some useful information about what is going on here. Any information is appreciated. c:
#archived-code-advanced message

zenith mulch
# rocky holly Since I have moved this question several times, I will just post the message lin...

There are multiple steps that could be the error.
So youre adding a new text in the hierachy. The content fitter should position it in a way that the position is visually below the last message. So first message is at -100, second is at - 200, third is a -400 etc. depending in their height. Does that happen correctly? Are the elements in the inspector even if they are not visually correct, logically correct?
Then there's the content panel which should increase in size with all added elements. Does the content panel increase to the correct values?
All the scrollbar does is fit it's values to the size iof the content panel.

rocky holly
#

@zenith mulch the content panel is not scaling to fit the child content size fitter

rapid ferry
zenith mulch
# rocky holly <@191510387357777929> the content panel is not scaling to fit the child content ...

Well, for a start, that explains why the scrollbar doesn't act like you assume it would and why your script code does not work. So, are the positions of the text elements correct? Does the last one go out of the bounds of the content panel? Do you have a vertical layout group and is it set to increase the size to fit its content?
You also need Layout Element on your text. The vertical layout and content size fitter of the parent use that.

rapid ferry
#

I already resolved it by making a new panel that uses vertical layout and many UI text. But was there a better solution? For future convenience blushie

leaden mortar
#

how do i change the size of ui with bigger res

mortal robin
gentle dirge
#

How are you supposed to have a Horizontal Layout Group whose children have auto width? Each child is a game object with an Image component, who then has a text object in it with a Content Size Fitter component with Horizontal Fit set to Preferred Size. I can't figure it out...

distant aurora
#

Am I doing doing thing wrong with importing an SVG for a button background?

neon valley
#

How to fix text mesh pro is blurry?

low pike
swift tiger
#

How can I make an image behind the button and make it as child of this button?

mortal robin
#

then move/resize EmptyParent etc

swift tiger
mortal robin
#

you can make your animator animate any object you want

cold cradle
#

Hello guys, I am looking for some nice GUI-assets. I want to use it for a fantasy game (PC). The most GUI's in the assetstore are too casual or have bad reviews. Can you recommend some assets? It should not be too cartoony. Thanks!

jovial relic
#

Idk what its called but its the thing that lets you select the alignment

#

anchor presets are completely gone on some objects

#

with no explanation

remote garnet
#

Hey everyone,

It's been a while since I used Unity (about 1-2 years).
Back then the whole UI situation was quite unfinished and I used the UI system that came after the IMGUI one.. not sure what it was called.

I want to start a new project with the latest tech, what's the currently recommended way to build UIs in Unity in 2023? I am shipping my games to desktop, mobile & console.

frosty pewter
#

UIToolkit will be the UI future for the whole of Unity, but it has major limitations right now that make it only suitable for specific projects. UGUI gets the job done otherwise.

remote garnet
#

Oh, okay, UI Toolkit is still not production ready, then?
I believe I used Unity UI (UGUI) on my last project but I was not exactly happy with it.
Would have hoped that the new system was ready after so many years.. okay.
Thanks for clarifying

#

Is UIToolkit supported on consoles?

low pike
worthy mica
#

Can somebody please tell me why is this happening?

#

Its m,y TextMeshPro doing this, whyyy?

low pike
#

Keep the scale at 1,1,1 and the font size above 1

acoustic venture
#

Why does adding/changing the outline and underlay of a text add/change it for all other texts in the scene?

unreal ivy
#

Question, is it better to change UI images using the width/height or the X/Y scales?

sterile wedge
unreal ivy
#

Hmm, so what's the reason for that?

sterile wedge
#

unless you're making like a.. tweening effect

#

scaling will affect children

#

quite bothersome to work with

#

and another reason i'm not sure about, it'll cause the quality to detioriate

unreal ivy
#

Ah, okay, thanks for the clarification then! I'll keep that in mind

hot roost
#

How can I rotate Textmeshpro text by 90degrees when the RectTransform is stretched using Anchors? For example I want to have the "Position" text be rotated. But if i set a Z rotation of 90; it rotates the whole box so no longer the right size/position.
Using the <rotate> tags on the text only rotates the letters individually.

weak trench
#

Is there really no way to change the step value of an slider for controller? I've been searching for days and I can't find it

meager quartz
#

i wish i knew how to make nice looking uis lol
watched a video on it so i know some basics, ... i guess ill just keep it super simple since this is the first game prototype
trying to make a compendium ui with entries on the different locations and creatures you can encounter etc

i was going to just show/hide different groups of texts and images depending on what is selected but theres probably a better way

kind swift
#

Is it possible to disable certain characters in tmp text?

swift tiger
#

How can I center the last line of images? I can't find it

sterile wedge
#

so something like
GridLayoutGroup
-Row
--HorizontalLayoutGroup
----Image
----Image
----Image
----Image
-Row
-- HorizontalLayoutGroup
----Image
----Image
----Image
----Image

cosmic mantle
#

I was beginning to implement some UI side of things and I was curious. A lot of beginner tutorials have you put a canvas on enemies/player units and then apply their health/mana/energy/whatever bars to them individually as prefabs

#

Is this not a bad practice and shouldn't I be looking more towards making one canvas that contains all character UI?

sterile wedge
#

No

#

Multiple canvas good

#

Many small canvas. One thing in canvas changes, only one canvas gets refreshed. Refreshing not so heavy

cosmic mantle
#

Ah, gotcha.

#

Ty, appreciate the quick response.

sterile wedge
#

Was just whooshing by. Good day

little hazel
#

Does anyone know why this canvas element would be rendering at 60px width?

#

The health bar thing

#

This is what it looks like in the inspector

#

oh wait I'm silly

#

the canvas was scaled despite me disabling the canvas scaler

#

nvm

lilac otter
#

hello guys i wanna ask why i cant hide my canvas ?

#

is it bug or something?

#

my version is 2021.3.16f1

low pike
#

I'm in the same version and it works for me

#

tried relaunching Unity ?

lilac otter
#

i try it multiple time but not working

novel bane
#

Can someone help me figure out how to make a health bar with a slider, the type fill method isn't there and I have no idea how to get it, because rn the health bar (that actually fills) just moves left when you increase the slider.

mortal robin
#

use a filled image

#

You will see image type (including filled) once you assign a sprite to the Image component

novel bane
#

How do I use a filled image?

mortal robin
#

just set image type to filled then you can simply play with the Fill Amount

novel bane
#

ah okay thank you!

untold gust
#

Is there a way for TMP text to go right to left when displaying text instead of left to right?

sterile wedge
gentle iron
#

how do i fix this overlapping outline issue on ui image

#

nvm i figured it out

tight sequoia
#

I'm having issues with a scrollbar. There is only one method that changes the value of it,
but when calling it the first time, the scrollbar resets to a relative value instead, and it has to be called again for the scrollbars value to be properly set to 0.
Is this some in between frame inertia of the scrollbar value of some sort?

#
    public void Wake()
    {
        StopAllCoroutines();
        canvasGroup.alpha = 1;
        scroller.value = 0;
    }

    void HandleNewMessage(InsightNetworkMessage netMsg)
    {
        GameObject msg = Instantiate(messagePrefab, contentWindow.transform);
        TextMeshProUGUI messageText = msg.GetComponent<TextMeshProUGUI>();
        ChatMsg message = netMsg.ReadMessage<ChatMsg>();

        messageText.text = message.Data;
        switch (message.Channel)
        {
            case var value when value == LocalName:
                HandleLocalMessage(msg);
                break;
            case var value when value == AreaName:
                HandleAreaMessage(msg);
                break;
            case var value when value == WorldName:
                HandleWorldMessage(msg);
                break;
            case var value when value == PartyName:
                HandlePartyMessage(msg);
                break;
            case var value when value == GuildName:
                HandleGuildMessage(msg);
                break;
            default:
                Destroy(msg);
                break;
        }

        if (message.Channel == currentChannel)
            msg.SetActive(true);

        Wake();
    }

#

In fact it seems like the scrollbar is permanently one message behind, despite the wake function being called after the message has been handled and added to the content view

tight sequoia
#

I ended up just making a Coroutine that waits a single frame before changing the value and it solved my issue.. strange behavior

carmine path
#

How can I change Raw Image shape

#

Can i make the shape of it circle?

low pike
#

A raw image is always rectangle.. the sprite you apply to it can be any shape

carmine path
#

then how can i make the render texture circle

mortal robin
#

by... making pixels in the shape of a circle

carmine path
#

i am making a minimap

mortal robin
#

btw there are circular minimap tutorials out there

carmine path
#

okay

#

thank u

sly tulip
#

is there a way to make ui text always = a variable without running it in update?

thorn zinc
#

you mean something like calling updateUIText(text) whenever you want to change it?

deft vigil
#

How can I make ui show up on an object? basically unity equivalent of roblox billboard gui

thorn zinc
#

try canvas > render mode > world space

mortal robin
sly tulip
mortal robin
sly tulip
#

oh wait, I just realized. not like slider, the opposite of slider

#

yeah, I'll have to dig around

#

a slider calls something if it changes. I was looking for something to change the text if a variable changes. a way to do it that isnt update or manually setting it when I also change the variable, which is what I'll end up doing if I can't find a way to do what I'm trying to

thorn zinc
#

you want to add a listener for it, it sounds like.

sly tulip
#

never used them

thorn zinc
#

neither have I tbh.

sly tulip
#

I will look into those as well, thanks

mortal robin
#

jsut set the text in the property setter

#

ez

thorn zinc
#

...ok so how do I do this? presumably with horizontal layout (or grid layout, seems to be working for me?) I want to keep all the cards within the box as I add more. Once there will be overflow I want the spacing to decrease to keep it to that constraint. There's probably a formula based on the total cards, but I can't figure it out.

sterile wedge
novel kraken
#

Hi there, how would I use a material with a shader graph for a TextMeshPro Text?

#

For the old Text you could give it a Material and attach a shader to it, with TextMeshPro I don't see that option

undone lichen
#

i have an image that looks like this. my intent is to put it in the UI, then put real + and - buttons on top of the image, and have those buttons work. but when i press the button on the UI and it greys out it looks like this, so I guess it goes behind it?

mortal robin
#

why not just get rid of the fake button in the image itself

undone lichen
#

ok so i guess i wanna make it grey out without going transparent

#

but i guess the right way to do it is to just properly make my ticket cost window

thorn zinc
acoustic sail
#

I'm trying to make a menu GUI pop out but it's going behind other GUI elements; I can't just move it below in the hierarchy or anything like that as other objects around it pop out on hover as well

thorn zinc
acoustic sail
#

like I said I can't move it in the hierarchy like the solutions are suggesting

sterile wedge
#

if so why can't you move it to the bottom of the hierarchy on hover or click?

sterile wedge
acoustic sail
#

yeah but how do you move it down

sterile wedge
#

it's a component

#

look up how to set object as last child..?

acoustic sail
#

omg I'm stulid

#

thanks

sterile wedge
#

so this whole time you saying you cant

#

you just didnt know how?

thorn zinc
#

transform.SetAsLastSibling(); , aaccording to what I linked said

vast fern
onyx tundra
#

How can I use shader material in ui with screen space- overlay

#

??

mortal robin
onyx tundra
#

But can I position the ui image at particular position on screen without canvas?

low pike
#

UI Image requires a canvas parent

onyx tundra
#

That's the problem I'm facing

low pike
#

eh?

onyx tundra
#

I need shader on ui image

#

And in screen overlay

torn sun
#

Hey , i have these spaces on the sides of the keyboard any idea why?
I am using text mesh pro

mortal robin
torn sun
#

what settings should I change? I can't find any settings related to keyboards or something

left halo
#

Hi all, I'm trying to implement a settings menu in my game where the user can scroll through items using the keyboard/gamepad, and have the menu move so that the selected item is always visible. As you can see in this video right now, if the user selects an item outside of the scroll rect, the scrolling simply doesn't follow. My research so far suggests that there isn't a built-in solution for this, and that I'll have to write a script (or use someone else's script) to get something like this to work. Before I get started on that, might anyone know of a faster, more plug-and-play way to do this with Unity?

cosmic mantle
#

I'm trying to implement some skillshot indicators and make the artwork for them. I was curious if anyone had some experience with this type of situation or had some insight. I wasn't sure if when designing the art for something like this what length I should make the image and then how to manipulate it. Like should I simply make one image for all skillshots and then simply stretch or shorten it depending on the range of different abilities? Should it be cut into two different images, one for the body/tail and one for the ending/head portion?

marsh cliff
#

Can I get someone to help me create a text asset for Chinese , Japanese , Korean text support please? I had 3 most common versions at once and still only got 50% of my game to show Chinese text , I would very much appreciate it

glass cloud
#

is it possible to have 5 inch diameter circle sprite on any resolution or device

mortal robin
glass cloud
marsh cliff
#

How can I fix missing characters/glyphs in Chinese text?

marsh cliff
#

Need to fix this so I can update with more language support

mortal robin
marsh cliff
left halo
# marsh cliff

As PraetorBlue said, I think that just means all of your fallback fonts still don't cover the whole range of characters you're trying to use?

#

I asked about this a little earlier in the chat but wanted to check again: is anyone aware of a way to accomplish scrolling behavior in a Scroll Rect like this? https://youtu.be/SaYqOcgiacE?t=133
I'd like to let the user scroll through a menu using the mouse, but if they use a keyboard/gamepad to select an item in the list, it scrolls the Scroll Rect to ensure that the item is visible.

Let's take an in depth look at the Nintendo Switch's home screen and settings.
Don't forget to ► Like ► Comment ► Subscribe for daily gaming videos!
► Follow me on Twitter: http://www.twitter.com/Arekkz

NINTENDO SWITCH SCREENSHOTS:
https://www.youtube.com/watch?v=TjmFzloa1yA

NINTENDO SWITCH ADD USERS:
https://www.youtube.com/watch?v=Tmp4FTH6Ea...

▶ Play video
marsh cliff
left halo
#

The difficulty with languages like Chinese is that there are so many glyphs, so it’s much harder to make a complete font

split stone
#

when i use a scroll rect it instantly bounces back to the beginning position. how can i fix this?

#

nevermind figured it out. forgot to enable content size fitter

slender zenith
#

hey the camera for ui overrides the post processing settings for the main camera even while the volume mask on UI layer only, any quick solution to fix that?

rapid ferry
#

How to press 2 UI buttons that overlap with each other?
When I click on the part where they overlap, I want them both to execute their unityevents

gentle iron
#

what is fade duration in a button component?

slender zenith
slender zenith
sour geyser
#

How do I hide a grid programically?

dense crystal
#

Was checking out some Scroll Rect stuff today and I'm not quite understanding the elastic parameter for the movement type. In the videos I'm watching, it seems like it smoothly scrolls to either end, but mind is rubber banding back to the original location (which, id honestly expect to happen under this setting)

https://gyazo.com/9e848a8e8c60cdf1af45334627a3e36b.mp4

obviously setting it to unrestricted is not what i need either -- but is there some setting here I messed up to cause this behaviour?

#

Aha! I needed to use a Content Size Fitter component to set the preferred size of my window to the correct axis 👍 I have never heard of this component before.

sharp belfry
#

This looks fine and normal? Am having some scaling weirdness

dense crystal
#

Alright, now any way I can set this so that when I add new items, it stays anchored at the top? Tried everything I can think of so far

#

oh im being silly i just wasnt pressing shift all the way down :p

nimble orbit
#

Anyone know what this code's doing wrong? Been stumped on this for days.

It takes a GameObject's transform.position, which would be that of a world-space virtual cursor that follows the mouse, and tries to see if that cursor is over top a UI object that's also rendered in world-space. I've removed any code that reveals secrets about the game I'm working on, since I'm under an NDA.

public bool TryFindRedactedAt(Vector3 position, out Redacted redacted)
{
    note = default;

    if (MainCamera.Camera == null)
        return false;

    Vector3 screenSpacePosition = MainCamera.Camera.WorldToScreenPoint(position);
            
    var eventData = new PointerEventData(EventSystem.current);
    eventData.position = screenSpacePosition.DropToVector2();

    var resultList = new List<RaycastResult>();
    noteRaycaster.Raycast(eventData, resultList);

    if (resultList.Count == 0)
        return false;

    foreach (RaycastResult result in resultList)
    {
        if (result.gameObject.TryGetComponentInParent(out Redacted prospectiveRedacted))
        {
              redacted = prospectiveRedacted;
            return true;
        }
    }
            
    return false;
}
#

When I click on the UI element in the world, I run this method to see what I've clicked on.

#

Result list keeps coming back as empty though

#

Unless both the cursor and the UI element are really close to the middle of the screen. Like the cursor position is in the wrong coordinate space

#

But I thought GraphicRaycaster expects the position to be in screen-space, and that's what the code is doing - translating the in-coming GameObject position from world to screen space

#

Is GraphicRaycaster suitable for world-space UI? Should I be using something else?

mortal robin
#

This seems to just be reimplementing built in functionality

nimble orbit
#

And I also want to ensure that it supports a virtual cursor, one driven by a gamepad's joystick for example

#

Which means I can't necessarily rely on mouse/touch events

#

Idea being the virtual cursor activates the UI's "editing" mode by acquiring a lock on the world object, and then we can either use pointer events or navigation to further interact with the UI

#

Naturally it's hard for me to explain why I'm doing this without breaking my NDA which is...frustrating...but yes, there's a reason I'm doing it this way

#

I just wanna know what the code's doin' wrong

#

Hmmmmm....by any chance...is GraphicRaycaster aware of RectTransform scales?

#

One of the weird hacks I did is I set either the scale of the UI elements themselves, or the canvas they're in (I forget which) to 0.01 scale

#

Otherwise they render EXCESSIVELY large, taking up the entire in-game level space

mortal robin
nimble orbit
mortal robin
#

I'm not convinced that you shouldn't be using the normal event system stuff

mortal robin
nimble orbit
#

The idea is, you click on the UI element, and the game tries to acquire a lock on it for your current player number (this game is multiplayer). If you get the lock, THEN the UI becomes interactible

mortal robin
#

if (isLocked) etc

nimble orbit
#

Yes. But I don't know what to lock if I don't know what the cursor is over top of

mortal robin
#

That's what IPointerClickHandler is for

nimble orbit
#

It isn't going to work here. The UI in question doesn't have direct access to the world, and it shouldn't. So it can't acquire a lock on itself.

#

This must be done by an in-game level editor tool

mortal robin
#

It can just call out to the Lock manager

#

"try to lock me"

nimble orbit
#

That'd...then require the UI element to have access to the world manager, which I don't want, because I don't want UI having a dependency on the world

#

UI should be reusable

mortal robin
#

It can just fire an event then

#

To invert the dependency

#

Then it's completely reusable

nimble orbit
#

I...just wanna raycast into the UI....

#

Another reason I'm doing it this way is

#

I only want to be able to click on this specific UI element type when the edit tool for it is active

#

And the best way to deal with that, without forcing the UI to be aware of the edit tool's state, is to have the edit tool do a raycast.

frigid charm
#

Im trying to make a main menu and the buttons wont click can anyone help

#

Im new to unity btw

frigid charm
#

please help

glass cloud
onyx flowerBOT
#

🧑‍🏫 Unity Learn can offer you over 750 hours of free live and on-demand learning content for all levels of experience! Make sure to check it out at https://learn.unity.com/

royal flame
#

I have a scroll view on mobile devices, and one thing that I've noticed is that when I try to scroll with my finger at a higher speed, the scroll view's velocity clamps far below the speed that I scrolled, making for a very unnatural feeling when scrolling compared to native scroll views

#

is there a way to fix this?

#

My scroll view has elastic as the type and the deceleration rate is at 0.135, which is default

green arch
#

Can't edit outline on textmeshpro?

royal flame
#

I think

#

You have to scroll up for the instance

green arch
#

Fixed :)

nimble orbit
#

What coordinate space does GraphicRaycaster expect for its Raycast method when the UI is in world space?

rapid ferry
#

Question: i have this little menu UI that open and close when i click the setting button but i also want the menu to close when i click somewhere else outside the menu so how would i detect that ? the menu uses an animator component with a trigger

flat halo
#

how do i make text overlap every object ?

mild kernel
#

Otherwise, you have to deal with the event system and checking for what's been clicked or not, and if you're in a specific state (drop down opened)

mild kernel
#

Or if you want it in the world, use a separate camera to render only the text and stack it (URP) or set the depth to be higher (Built in pipeline).

rapid ferry
#

chatGPT literally just gave me the whole script working lol

#

this is beyond amazing lol

gray badge
#

Can someone help me with my problem?

For some reason my mouse offsets when using UI through a render texture displayed on an object. Screenshots don't pickup where my mouse is so I drew it.
At first I thought it may have something to do with the screen being curved, (I have no idea look I'm a beginner)
but I tested on a flat object and that wasn't the case. I am utterly stumped.

gray badge
#

My ui itself is set to a camera which overlays onto a base menu camera. Then the texture renders the menu camera and the game views the render texture through another camera.
Only problem is, while the camera is projected on the tv, the ui itself is still native to the regular screen position not the one projected on the screen. How do I make it so that its clickable on a render texture without this weird offset?

violet sandal
#

i always get this info box in my content size fitter.
But how could i get rid of this?
Its in the ButtonContainer, but i need the button to grow with the Button text.

mortal robin
violet sandal
# mortal robin If it's working properly just ignore it

Okay 😄
It does, but i got the problem, that the vertical layout group in the ExplanationContainer just puts everything on top of each other at startup.
I fixed it with LayoutRebuilder.ForceRebuildLayoutImmediate(); but im not sure, if this is a smart way.

ebon iris
#

Someone here know how I can make a custom "hitbox" for my image. because now the half of the screen is the hitbox for the image and I only want to have the round image?

low pike
#

The raycast area on UI is the size of the RectTransform.. so resize that

#

Also, when using UI, press T to use the UI gizmo tools

ebon iris
#

Okay, but then how do I change the rect transform that its round?

low pike
#

you cannot

#

If you want the graphics raycast area to be exact to the image shape.. there is no built-in way to do that

ebon iris
#

Oh, I want to make a selection like this

#

So this isnt possible?

low pike
#

Yes it is

#

One easy, but not the best, way would be to have 4 squares (with alpha 0)

ebon iris
#

I found a way I think, I just can rotate the image so its faced to the side so I get my angle

#

Yes, thank you dude 👍

near folio
#

I've just discovered the difficulties with working with EventSystem, in particular with trying to process the cancel event to close a menu when nothing is selected. Other than the pinned post, has anyone created a list of known pitfalls with Unity UI? I'd rather not discover more issues on my own, if it can be avoided.

nimble stirrup
#

Hi everyone, new to the server! How can I make it so no matter which button I'm hovering over, it stays on top? Similar to overwatch 2

near folio