#📲┃ui-ux
1 messages · Page 7 of 1
@mortal robin I did eventually fix my raycasting issue, it was a rendering problem of all things
BUT
...No Button object on the UI element is clickable, neither is my IPointerClickHandler being fired
Figured this out too, turns out I had a Canvas Group blocking it
Now I can't click on a TMP input field in world space
Clicking on buttons works fine, but I can't focus an input field
Is it true that it's better to code your UI animations?
rather than use Unity's In-built animation tools
Yes, you can search this up. Here's official word on it https://unity.com/how-to/unity-ui-optimization-tips#optimal-use-animators-ui-elements
Ah okay, thanks.
honestly probably should have already known
I use DoTween for animation like this and it works great
I'll have a look into it
since the animations I do are pretty simple.
at most, its just a twirling path, with some fading
Does anyone have working blur in URP when there is sprites and other UI in background? I need it to work like frosted glass, Seems things work if there is 3D object behind it but not when there is sprite or other UI.
hey, any reason why a Pointer click event trigger stopped working after I added the related gameobject into a grid layout group?
Select the EventSystem while playing to see what your pointer is interacting with
oooh youre a life saver, i have no experience with unity's UI
Anyone know how to get a TMP Input Field working on a world-space canvas? I can't seem to get it to receive pointer events OR get keyboard focus
But if I place a Button, or add a script that implements IPointerClickHandler, I do get pointer events on that. So I know my event system and graphic raycaster are working properly
You're modifying the material that both texts are using
Yeah it's good, I solve the problem thanks
I'm having issues with a scrollbar ive setup and I've followed a few guides all the way through and I am not sure what's going on, but despite the icons existing in the scene editor they won't actually show up in the simulation, and they do have sprite renders, and I think the layering seems to be fine, so I'm stumped
Ok scratch that it's probably something with the layers and following more guides and forum posts has got me more lost
here image of test
My UI isn't showing up on my camera, here's my setup
Don't use a sprite renderer. Use UI images
There are some fundamentals you should know when working with unity UI so I'd recommend finding a tutorial video on that
Got it, thanks!!
I have a problem with the canvas , i'm trying to make a simple pause menu, but whenever i switch the game view, the canvas stays at the right side of the screen
as long as you're using a screen space canvas, the canvas will always cover the entire screen
I tried lot of solutions but nothing helps
It always looks like this
Because you're using a screen space canvas. What do you want it to look like?
Don't develop UI with the game view set to 'Free Aspect'
Looks like what
I already fixed it
is there a ui component similar to this? you use the arrows (or arrow keys) to scroll through different options
dropdown isn't exactly what i need as i dont want a huge list to plop up
or do i simply just add a text field, 2 buttons and then increment or decrement an int that will in turn change the current element in an array that displays the text?
this
👍 gotcha
How do i add selectables for the drop down button?
Add all the options
Right now its just blank
It should show options here
Hello. I have an Image UI game object. The Source image is a Texture Type Sprite. Somehow I automatically have a box2D collider by default and I cannot turn this off. How to delete or remove this box2D collider? This is definitely a collider, I have tested it.
Press the ... and "Remove Component" on the collider
i have a text mesh pro and im getting this weird box around the letters with bright colors on the text. anyone knows what is causing this?
i think it was because it was set to bold
I have asked a wrong question, but now I have found the answer. Thank you for responding anyway.
How can i disable this option? I don't want that a button stays selected
It makes the buttons buggy, per code or per unity, how to disable this?
if navigation isn't needed you could disable it
Thanks, it helped
how do i anchor a object to the left and also let it stretch at the same time
my prefabs are larger than the resolution I have set and it's throwing off the UI. Is there a way to make prefabs have the same resolution that the main canvas has?
instead of using Button, use an event trigger and just add an OnPointerClick listener
interesting, i'll take a look, thanks
Would anyone here know why the hitbox for clicking is much bigger than the actual button component in my scene?
i.e. i click credits even when im way off of it, the border extends all the way to even overlap plays button
I colored the border of the button just to show that its not that, or atleast thats what I would assume, idk whats happening here
Hello. I have an issue with UI. When I turn on Anti aliasing all UI in my game view disappears. Have anybody encounter with this problem. Any help and ideas will be appreciated.
Howw'd you guys implement a map panel containing nodes(cities) and edges(roads) and each time a player wins a mini game the appropriarte city changes color?
Hi, anyone here uses Doozy?
I'm trying to create my first flow graph but I can't edit nodes in the inspector, everything is greyed out.
Same thing goes for nodes from the examples.
Is this because I got the free version?
guys how do i make UI like that? (straight line following object)
i dont know key words to google it
I would use this function to drive the position of screen space UI elements https://docs.unity3d.com/ScriptReference/Camera.WorldToScreenPoint.html
hi there
how do you guys handle controller navigation on a grid layout?
Anyone knows this issue and the fix?
not from that info
is it a world space canvas?
The position is relative to the world yes
tsf.position = obg.localPosition + new Vector3(0, (float)0.5, 0);
The Text is how you see, parented to the Panel, a Cube
Since with local position it would be somewhere in the sky, i needed to use position to get it over a not Canvas object. tsf is the Blue panel
you don't move UI elements around with .position
but with your answer, it sounds like you don't understand what I asked
When moving a World Space canvas around, you'll move the transform around. But, no matter the canvas render mode, you move the UI elements around with the RectTransform
transform.postion != UI positions
This doesn't quite make sense either.
The TMP is a child of PickUp_Tablet.. is this an actual cube? Not UI?
Yeah
Don't put 3d objects on a canvas like this
If you just want text on the cube, use the 3d TMP - which doesn't require a canvas
If you want more than just text, then use a world space canvas, as a child of the cube, and size it correctly
for non-canvas TMP
oh wait, there is Text mesh with tmp too?
Sorry, im new with Tmp
It got replaced, i see
I'll try out quick
Thanks, that was what i was searching for
#💻┃code-beginner message I was directed to this channel could someone help me?
Set your canvas scaler Screen Match Mode to "Match Width Or Height"
Same issue ^^'
I can provide any more info needed
i fixed it, i just basically had to set the scale in the script file
There is a way to check if the Image is visible? I'm using a Mask for minimap, i have like 400 icons on the map and i want to run some code only to the visible icons.
My text is supposed to appear when I build and run the code but it doesnt show
when I run it like this, it shows
@low pike?
This is how it looks from the scene
When editing UI, think as if the objects in the world didn't exist, and vice-versa.
It's just how Unity renders your Canvas so it's visible for you to edit. Once in play mode, it will adapt to your camera size.
It's completely normal that it appears so large
no need to change it
No, you should not change that
How do I make it so that the UI shows when I build and run
switch your canvas scaler to scale with screen size
Select your EXP counter there and show its Inspector
That's so anchored to the center instead of the top
it did this
Press T
told ya
that is not your Canvas Scaler
if you don't put it to scale with screen all this anchoring is pointless.
ok good
when I change it to scale with screen size it does thus
Yep see the square that says "middle center" at the top-left of your Rect Transform?
This means "position the object relative to the screen's center point"
it's fine now you need to pivot them
and they will stick correct
You need to tell it to position relative to the top-left for the HP bar, top-right for EXP, and top-center for level
Click the square icon and it'll show presets
this ^^
Holding Alt when you do that will also snap it correctly in position
so since my exp is on the right
You'd want it to stay on the top-right corner whatever the screen resolution is, right?
do I have to just readjust the sizes now
Im going to run it now
thank you it worked
thank you as well
You can test it out quickly by entering play mode and resizing the window. It'll adapt the UI if set up correctly, no need to waste time making a build
what does world space do on canvas scaler?
yes def poup the Game window when working with UI
puts your canvas at a specific point in the world
you can scale it like a regular gameobject
rotate it
etc
oh
You use it if you need to put UI objects at a specific position in the world. Think digital wall-mounted clock or computer screen
When working with UI , press T to work with the UI tools
change the reference resolution to whatever resolution the game window was in when you first made this UI
2560x1440
what would this change?
reckon this is a usable layout for UI for a bestiary/compendium sort of thing
i feel like maybe its overcomplicating it
maybe i just cut out the regions entirely
hi there
does anyone know a way to determine child placement in a grid layout group?
like determining which child is above, left, or right, etc to the current one
I don't know without putting it together myself and working it out.. which I'm not gonna do.
Post the question and relevant screenshots, someone else might know off the top of their head.
Hi I'm trying to make my sprite size same to all devices regardless of resolution but I tried it in unity emulator it doesn't work
https://codebeautify.org/alleditor/y23adba0d
if i have a button with negative space at the edge, but I don't want this space to cause a button click if clicked on, can I change the buttons clickable area?
need help! i have a grid layout with a bunch of buttons. unity has highlighted, selected and pressed states for buttons but it seems like when im using a keyboard or controller to navigate it completely ignores the highlighted state of a button. how can i keep a button highlighted that was last selected with a controller or keyboard?? i cant find a solution
UI Navigation generally works pretty much "by default"
can you share a little more details about your issue?
Are you using a mouse and keyboard/controller at the same time?
hey no i dont want to use the mouse at all but the navigation is completely different for mouse and gamepad/controller. when i click a button with the mouse and move to another it keeps that highlighted state and the button stays looking highlighted too. with gamepad it does not do that. i have images for selected,highlighted,pressed,disabled.... but it seems like the gamepad instantly switches the button to pressed state just by navigating to it
so the last pressed button will never be highlighted
and there is no selected state
its very weird. most people when i was searching for a solution want to have that keyboard behaviour when using the mouse ,too. and i want it the other way around 😄
here im using the mouse first and then switch to gamepad. you can see the difference
when i click a button with the mouse and move to another it keeps that highlighted state and the button stays looking highlighted too
No the mouse will cause the button to show the "highlighted" color. Which is not even a thing when it comes to joystick/keyboard
Joystick/Keyboard will actually select the new button and deselect the old. This is actual UI navigation in action
so the last pressed button will never be highlighted
Correct, if you want this behavior you'll have to create it yourself
okay :/ i slowly understand whats going on.i think i need to make a custom mouse pointer or something. thanks
why isnt this working? i have a custom button script.
this is my button script
why doesnt it change to the pressed button sprite?
@rapid ferry These are the sizes of children, and the size parent (before and after applying the content size fitter, this is after actually)
The reason you cant see the children below the "screen" is because there is a mask, but they are indeed there, just invisible
their inspectors?
where is the layout group component? try to unchecking the child force expand
that is actually fitter already btw, what else do you need to do with them?
ummm, well i need to adjust the size of a parent to be this (u made it yellow) size, so that then it adjusts itself to the scroll, since the parent ("CharactersButtons") is the content of the scroll
use grid layouts on the CharacterButtons
then adjust that
well, i cant really do that
there is this one thing, called Character Line
and that breaks this entire idea
its this object
and i dont think it will work in the grid
oh I see, yeah that would ruin the whole thing
I am thinking of using separate verti and hori layout group, but that is kind of hard to maneuver
want to do it?
ummmh idk how to really
ill tell you step by step
alright
okay, right click the charbuttons, add empty
i already got lost lol, charbuttons u mean the parent right? CharacterButtons?
then add verti group
and add empty gameobject?
the ChracterButtons gameobject lol, you name it that way
yes
I don't recommend overriding Button. Simply implement IPointerDownHandler and IPointerUpHandler or use Event Trigger
by overriding button you're removing the normal behavior
how would i use these things?
never mind i figured it out, thank you!
Hello guys!
I need some help with the UI implementation
I have an element that is a part of vertical layout group, and that element has to be expandable, when I press button, it reveals additional options
How can I implement that extendable element?
Here are the screenshots:
Whay does TMP not showing all the greek letter of the alphabet? What settings do I need here?
do you guys have an idea how to do a ui looking like this with this kind of 3d distortion
like a futuristif hud
or just give me some keyword so that I search how it's called
please
yeah something like this
so im trying to make some ui automatically get the height of a text mesh pro, but it seems like the TextMeshProUGUI.textInfo.lineCount is inconsistant. Sometimes it says 4, when its actually 5. and 6 when its 10. and other times it says 4 when its 10+. though somehow its consistant to what it gives me, it just does not make any sense to me. anyone knows what is going on here?
the only logical thing i can think of is that it only counts the lines within the bounds of the text. but idk why it would do that and not count all lines
Is there a reason you're not using the content size fitter component?
uh, didnt know that was a thing
What's the difference between an Image and a Panel?
The only difference is the preset values in the Rect Transform
And the Image component on a Panel has a source image auto applied
Now back with a similar issue again. The "Use Hotkey" a UI Image(Using because the Transparency on the Sprite), doesn't show up on the game view, like the last time i put the mesh cube and the TMP as child of the mesh cube into the canvas and moved them together. The Image has a Fake Parent script attached, means i can use it like it would be the child of the Cube(the Blue background).
Now there are things that got thought my mind:
1.There is a problem with moving UI Elements around, because the UI is relative to the screen(Makes sense i think because the Canvas has a Area to put the UI Elements in, if they are out of that Area, they are out of Screen)
2.I need to use a Mesh Cube again, but i don't know how to keep the transparency of the Image/Sprite, so the Corners stays like it should
3.There are other and/or better methods for doing this
Ignore the fact that i attached 2 Fake Child scripts, fixed now(This isn't a solution to the problem, just to not get confused by that)
In a VR app I have a pop-up UI menu with buttons and a couple of check boxes. The right-hand primary button enables and disables the menu. When visible I can of course click the buttons and check a box but... (this is funny) when I toggle the UI menu closed and then open again the last element is clicked again.
So if it was a checkbox that I turned off, when I close the menu and reopen it, it toggles it and it is on again. If the last item was a button (like Play) then it presses Play again.
Any ideas what I've missed and/or how to stop the behavior?
thoughts on a "Confused" status icon?
I do like having the halo but seeing them side by side it's a little busy compared to the other one.
what if you removed the bottom question mark
Hello, I am trying to instantiate one of my UI gameObjects in another UI window. The corresponding code that I use to instantiate is the following:
public void InstantiateSelectAchievement(GameObject selectAchievementGameObject)
{
GameObject gameObject = Instantiate(selectAchievementGameObject, AchievementParent.transform.position, Quaternion.identity);
gameObject.transform.SetParent(AchievementParent.transform);
gameObject.GetComponent<RectTransform>().sizeDelta = selectAchievementGameObject.GetComponent<RectTransform>().sizeDelta;
gameObject.GetComponent<Button>().enabled = false;
}```
The original UI gameObject (selectAchievementGameObject in the code) is shown in picture 1 and it is a child of a layout group, shown in picture 2. AchievementParent is shown in picture 3. However when I try to instantiate my gameObject the width of the UI is 0 (like shown in picture 4) and I have no idea why. Help would be very much appreciated thanks in advance 🙂
I have a selectable Window object in my scene (actually, several). And each window may have child selectables on it (for example, input fields and buttons)
Is it possible to detect, on the window, when any child selectables are selected?
I wanna make the window look focus when it or a child is selected, and make it look unfocused otherwise
Scifi HUD in URP https://youtu.be/OmCjPctKkjw
In this video we're going to take a look at Camera Stacking with the Universal Render Pipeline, in short URP, using Unity! Using Camera Stacking you can layer game UI in Unity very quickly, and author high quality user experience.
Download the Cockpit demo, along with other URP example projects here!
https://on.unity.com/3jUFeQm
More info on...
would anyone know how to solve this issue, i want to center this image (the basic tower) no matter how many children there are in the outer panel
trying to make it so if I duplicate the tower image it automatically centers everything
I'm just switching from Godot so I don't know how to do this exactly
oh I figured it out
can you just turn off raycast target for MainUIContainer's graphic (Image?)?
you don't need it to be clickable right?
I don't need it to be clickable, just tried to turn it off but it still didn't work
it still says I'm hovering over it
oh shoot sorry it didn't uncheck
okay so now it's not showing me as hovering over anything lol
OH my bad I figured it out
one of the things was randomly not Raycast Targetable
thanks for the help <3
Hi can anyone please help me
https://www.reddit.com/r/Unity2D/comments/1194ux2/set_scale_of_sprite_to_same_size_on_different/
2 votes and 2 comments so far on Reddit
Hi anyone know why my sprite are begin imported as Default Asset instead ofTexture2D?
what file format is it ?
solved it. thank you!
Hi guys. Is there a way I can use dds as UI instead of .png?
never heard of dds, there won't be built in support for it
Right now the dds is working more like a texuture but i want it to work like the "Exit Game" button which is just png
i guess there is no way to fix it 😦
in UI builder how to set on hover animation: background-colour of button changes like it's filling from left? Also scrolling text animation for button names
how to enable or disable Canvas via C# script?
A Canvas is just like any other Behaviour and can be disabled via the enabled property
like this?
sure
nice
you'd write false to disable it ofc
You don't really need GetComponent - you can directly reference it in the inspector too
public Canvas myCanvas;```
ok thanks
As I wrote above. In a VR app I have a pop-up UI menu with buttons and a couple of check boxes. The right-hand primary button enables and disables the menu. When visible I can of course click the buttons and check a box but... (this is funny) when I toggle the UI menu closed and then open again the last element is clicked again. I've discovered something. It appears to be connected to enabling and disabling the UI panel. Doing that causes the events to fire as far as I can see and that causes the focused item to "fire".
I set the UI events with "obj".onValueChanged.AddListener() if that has anything to do with it.
Hey so I have a VerticalLayoutGroup of messages (with a title and a body). How can I make it so the body of the messages scales the message background size vertically (possibly using a Content Size Fitter) if the text is a TextMeshProUI and starting from scratch? I've tried multiple combinations without luck, thanks!
Is that a zoomed-in play mode?
Yeah, but got it fixed by enabling "Generate Mip Maps"
You don't judge UI based on the scene view. Look at the game view
I got it all fixed, but thanks tho
i want these buttons to stretch to fit the bottom to the top
this is the parent
a button looks like this
when i scale the screen smaller however, the spacing and scale does not adjust to fit the new screen height
i have a problem with ui, in editor it's clear but in game it's kinda pixelated and ragged
could be anti-aliasing
Is there a way to disable that?
can you send the camera settings?
also you're zooming in, could be an issue as well
you have the scale set to 1.3x
I will send it kinda later, I’m away from my laptop now
ok, i am on my laptop now. i will send you these settings
you're zoomed in
ohh
wtf how i could be this dumb bruuh 💀💀🗿👌🗿🗿
thx for help man
Tick Control Child Size height
guys i need the keywords
idk what was that called
hello?
thx
@ocean sedge Check that your button is clickable at all.
im having problems with my button not doing anything when clicked
i added a debug.log
does it work at runtime. Shows change state on mouse over
m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_MethodName```
thats the button its linked to
uiOpener.Clicky
the function in the screenshot above
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
public class uiOpener : MonoBehaviour
{
public static bool uiBool;
public UnityEvent OpenUIButton;
public GameObject uiObject;
private void Awake()
{
uiObject.SetActive(false);
Debug.Log("awake");
}
public void OnClicky()
{
Debug.Log("click");
uiObject.SetActive(true);
OpenUIButton.Invoke();
}
}
this one
I mean can you see the button work on the screen.
Button has tint color that can change on click or mouse over, Does it work at all
Is your EventSystem active? Select it and look at it
Then you have some other UI element covering the button. Text rects and invisible images would block raycasting.
OnClicky?
What's with the 'y'?
Has it been assigned to the UnityEvent in the inspector?
For starters turn everything off except the button and test if it works. Then find what covers it
Yes, they didn't move their entire question. Event is assigned, seemingly to a correct object.
aight ill check them now
i checked the ones i thought
and nothing happened
i cant find iut
*it
EventSystem at runtime also shows debug screen in the inspector. Extend it from the bottom if it's not. You can see what object mouse is over and read what blocks raycast.
oh ill check it
Also just place a simple button on a new scene and make it work. Note all the parts making it work and compare.
my other buttons work
with the same script
Has this canvas got a Graphics Raycaster component on it?
so add one
Did you not create that canvas from right mouse click?
nah
that's your problem 😉
checked it, stil not working
also when i scale the screen to be wider, the buttons expand past the window borders
0 spacing
whats the word when text entries are displayed like this
t
te
tex
text
where each letter loads in quickly 1 after another
i want to look up for a tutorial on how to do this but i dont even know what its called 💀
maybe this?
you can do this using coroutines, where on every x miliseconds you update the text label
thanks
@grave lily Please read server rules about giving ChatGPT answers. If you want to get an answer actually research the topic yourself.
For typing effect you would want to look into StringBuilder because you will assign a letter to the same string each time and assign it back. So you need an efficient text object to work with to not create huge amount of garbage manipulating strings.
@meager quartz For the question you've deleted. Concatenating strings the usual way creates new string each time you do an operation.
Why and how to use StringBuilder:
https://jonskeet.uk/csharp/stringbuilder.html
sure, it just told me how is it called
where can i find the image for this sprite? it says Resources/unity_builtin_extra but i can't find it anywhere in the projects files
Hey, Im trying to select a piece of text through code, but nothing seems to be happening other than the text just flashing for a moment.
working with TMP_InputField
I tried googling but nothing worked yet
https://gyazo.com/2c02dcd683935358beb335137bb7cd4b
In typical RPGs, you can hover your mouse over a stat in the stat sheet to see an explanation of what it does (as shown in the screenshot- credits:Brotato). How can this be adapted to work for mobile devices?
looks like TMPro is no longer working with Rect Mask 2d's softness property.
just wondering if anyone has a solution
Hi, I am using custom cursor in my it works but the cursor is really big in my game, I am using a Cursor pack from assetstore with comes with 64x64 and 256x256 textures
What is the solutions to decrease the cursor size
At run time
hey! i am trying to make a gameover screen panel, but can anyone please help me as to why my gameplay (pink) screen has shrunk? and the canvas size is massive?
This is normal for a screen space canvas
Double click the canvas in the hierarchy window
Think of the big rectangle as your screen
UI elements in the middle of the rectangle will be in the middle of the screen
ohh
it looks like this in the scene view
and this in the game view
when i try to shrink the panel it doesnt show up in the game view
could i make a game over screen with tile maps ? or is panel the only way?
You shouldn't be shrinking anything
Your game view is zoomed in 2x
oh how do i zoom it out?
Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
great thanks !!
my game looks fine using unity simulator for phones, how do I make it automatically scale depending on device, as you can see my game is cropped on my phone
Show your canvas scaler on your canvas
someone helped me it works now
if anyone needs to know change the canvas scaler to change resolution
for a simple HP Bar, any suggestions on how to set the anchors of the retransform for a slider?
use an Image set to filled
Filled? How does that work?
It's a setting on the Image component. Try it
I don't see it
There's not much to the Image component.. please poke around. I think it's called Type. Might be Simple by default
Oh I’ve already figured it out and made 2 Health bars
what can I do to fix this for text mesh pro?
got it to work on a different font
why does my font look normal in the scene view but not in game view?
Can you guys tell how improve visibility of ui element. I have sky background and ui lines are light blue. And the health bar is partially transpaent in the middle. The fill part is green. I'm adding reference image. But i our project we use it at sky background to make UI less distracting. Maybe to change size of element maybe to change something else target platform android VR. We use URP in our project.
it seems the issue is if the game view is set to an aspect ratio and not fixed pixel size
It's either too small or you've set the wrong size for the font asset
@lusty plaza the problem was the game view being set to an aspect ratio instead of a fixed resolution
Yeah, in aspect ratio it's probably rendering at a lower resolution, which makes the pixels in the font bigger than the pixels on the screen
thx tho
why do i not see my sprites in game view
what sprites are you expecting to see?
Where did you put them?
What components are they using for rendering?
so im making a computer you can open n stuff and see some files and text(lore) but i only see the text, i use sprites for a window and the file icons
canvas
Is this supposed to be UI?
You're not using the correct components if so
You should have using Image, not SpriteRenderer
thanks :)
that did it
Does anyone have a simple guide or anything that can tell me how to create a Listview within UI builder? Everything I see uses gameObjects, but my whole UI is built within UI Builder. I
I should also mention its a runtime UI
my b
How could I pull out something like this? I want the character on my TB RPG to be folded paper, but how can I put UI that changes on the texture?
it this the right channel for this question? I am new to this server.
draw the UI to a render texture
use that render texture in a material on your folding paper
<@&502884371011731486> ^
thanks
All of a sudden my font asset became corrupted or something, and the Japanese kana table was reduced to like half of the characters, and some Chinese characters don't render. I haven't changed any settings, but who knows. What may cause things like this to happen to font assets?
I found some warnings relating to this in my console
I also imported the same font asset from a different project where it seemed to work well. It had more characters this time, but I also notice that the characters missing this time are the same as last time
it seemed to have gone well up until the まみむめ row, so is my Unity having problems importing?
I used the same font file on GIMP, it completes the whole table
I have map that is randomly generated. It instantiates node points which are prefab gameobjects at random positions and connects them with lines.
How do I get these map nodes to be navigable via keyboard/controller?
Well you'd generate a graph data structure from your nodes and edges, then on input you just check the neighbors of the current node in your graph, decide which neighbor (if any) should correspond to a given input direction, and move to said nide
I think where I am missing something is how do I make the instantiated GOs also act as UI elements. I can add a button to the prefab. I thought Unity had a built in system where it would use the event system to navigate the UI buttons.
If we're talking about UI then yes
I thought you were not talking about UI
Hi! I'm looking for a quick tutorial on UI that tries to stay on a world point but stays on screen if the point in the point goes outside the camera
If this is the right place to ask about Font Assets, I was wondering if there was a way to "add on" to a font asset (I forgot to include the ASCII set in my hex list) without recreating the whole thing. Mine took like an hour to create because it had like 8000 characters to deal with. Thank you very much for your time.
It has been over hour since you asked so...
You can have fallback fonts in TMP
How do I set a max width for an UI element? Thats not 300px
Thank you, I'll look up more on fallback fonts
How do they work? I couldn't find a documentation on them, just a few forum threads on specific issues people had
the TMP docs have a page about them
oh right
I have been struggling to get this to work for hours now. I have a <font="OpenDyslexic">word</font> tag and whatever I do, TMPro seems to be unable to recognize it. I tried putting it in my own Resources folder under "Fonts" and changed the settings for "path" in TMPro to "Fonts". No luck. I tried putting it in "Fonts & Materials", in the TMPro Resources folder and changed the settings back to their defaults. No luck there either. The spelling is correct, the file is named OpenDyslexic.asset but TMPro seems to be unable to recognize it no matter what I do. 😦 NEVER MIND. I switched it to the root and that worked. Switched it back the way it was and now that works. No clue why it wasn't working before.
Hello, I have a question about how should Unity's UI tools be used in my situation:
I have a rectangle, where on the left side will be an image (it has to be 1:1 aspect ratio) and on the right side will be 3 text components (look at attached image). I want to make this rectangle responsive. What do I mean by that is: when I resize the rectangle, I want image to stay 1:1 aspect ratio, I want it to be the same height as the rectangle, I want the text in the right side to start where image ended.
I tried putting horizontal layout group on the parent of image and text parent (all text components are in one parent) and I put aspect ratio component on the image, but it shows warning, because it shouldn't be done this way. So how should it be done?
The warning text:
Parent has a type of layout group component. A child of a layout group should not have a Aspect Ratio Fitter component, since it should be driven by the layout group.
how to make it less pixelated so it wont look like it was made in ohio?
Use TMP , not Text
There was no check mark option in tmp
I want to make an option that lets you disable or enable antialiasing
So I need to make a check mark option
I'm sure you can work out how to Delete the text component and add the TMP component
Ok
Hey fellas I have a question that probably has a very simple answer I'm just not too familiar with UI tools. So I have a background sprite in my canvas for both my Date and Hour texts. Right now their edges are quite sharp and I want them to look more fading-out ish on the edges. How could I do that?
Try looking into rect mask 2d
okay thank you I'll look at some tutorials on it
Does it really look that bad in game view?
yeah.
Are you using Text or TextMesh component (i dont mean tmpro)
i am using tmpro, no idea what is textmesh
i want to make a dropdown menu using tmpro but when i change label text and play it, the text resets
i need to watch a tutorial on youtube
Should player Deck and Opponent Deck be the other way around?
(because in the duel the player is on the bottom.)
it was more of aesthetic question. Is that not a ux question? "Where on the screen should that ui element be?"
is it possible to get a game object components via button click?
can you elaborate on your question. Get the components where?
to do what with
i want to reference this game object image component so i can make another image equal to it, i know i can just use public to reference it but i have many other images here and that would be a lot of work, so i was wondering if i can get the image component from the object that is being clicked on
of course
how
Isn't the object being clicked on the button?
You either assign the Image in the inspector, or use GetComponent<Image> on the button object
presumably if it's a prefab - you'd only have to do the inspector assignment once. Or, again, use GetComponent
its not a prefab
probably should be, TBH
otherwise you're going to have to configure every one of these buttons manually
but the button just triggers functions, how would i use get component
sounds like the pseudocode you want is
assignSprite(gameObject g){
selectedGameObject.getComponent<Image>.sprite = g.getComponent<Image>.sprite;
}
putting that in some sort of image-assigning controller. presumably the object are selecting is already stored somewhere?
the script is on the canvas so this wont work
or i did it wrong idk
pass the GameObject you want the image from in as a parameter
example?
im not really that experienced with coding
ok so if you have a gameobject that has a controller script in it, you can drag it from the hierarchy to the on click event in the inspector.
if your function takes a parameter
understood nothing, im just only used to unity scripting
Unity scripting uses C#
still quite diffrent
Nope
it's normal C#
Highly recommend investing a few hours to learn the basics:
https://learn.microsoft.com/en-us/training/paths/csharp-first-steps/?WT.mc_id=dotnet-35129-website
You won't get that far without knowing C# basics
thanks
@mortal robin i tried this but didn't work yet no errors , what did i do wrong?
Can you show where you call this function?
from a button
that is attached to a gamebject with an image
Show how you have the button set up to call this?
And honestly if you don't understand parameters and want to wave it off, you will not get far as Praetor said
Start with some c# basics first
i find trying things much more affective then watching tutorials
@ebon monolith
This isn't a video
o
guys why i cant click button in Screen Space - Camera canvas?
so guys I have a list of buttons and I want to add an sprite to the highlighted button amongst them
I 9-sliced the sprite so that the borders don't get stretched and only the blank part does but that's not happening
those are the settings of the sprite and button
this is how I expect it to be stretched but can't figure out
Hello 👋
I have game objects laid out in a Grid Layout Group
I'm facing two challenges now:
-
I have a code to enlarge on hover. The thing is, I wanted it to stay on top of everything else in the grid when it enlarges. Changing the Z value is not having any effect. Is the Grid overriding it? What can I do?
-
How can I make the grid overlap elements more if the list continues to grow?
Help much appreciated, thank you!
From what i understand ui elements ignore Z value, i think you have to use scale instead
The UI gets in a weird angle when i look up or down, My render mode is camera so that it has post processing applied to it
so i have this prefab here. which is a popup text box. The popup object is a panel with a vertical layout group and a content size fitter, and the container object has another vertical layout group so that whatever text is displayed on the info object it will always fit the text. But this UI is not scaling to the screen size. is there any easy way to do that without writing code or should i write a script that reads the sceen size and scale the entire object acordingly?
did unity have support for stuff like 3 tabs which you can navigate between and when you selected one it will allow you to navigate in the tab's menu itself so basically you are restricted to a few UI elements until pressing confirm
like this so you navigate between the tabs first and when you press the confirm key it will lock and allow for you to look at the options in the tab menu
Unity's UI doesn't include much when it comes to templates like this, or at least as far as I'm aware of. This one shouldn't be too hard to recreate though, as you'll just need to make a script with a few pointer events to toggle what's to display.
Yeah, mostly want to create a system so i can only have a few ui components active for navigation until something is selected
With a worldspace canvas. When the UI is hidden; enable = false on the canvas component vs disabling the whole gameobject...is there a big performance difference?
is it a good technique of making a game menu? just disabling or enabling it whenever player pauses it/plays?
It's an ok way of doing it yeah
nice
i want to make an option that lets player turn vsync on or off, which ui element should i choose?
Faced with a problem when creating AssetBundle for font to use localization - the resulting file comes in 400kb and does not work when using, does anyone know the solution?
(Original TMP file with sd16 is 30mb)
So I have 2 Player hud blueprints for during the labrynth, which would you say looks better?
im trying to make the mask transparent
i was using the yellow circle to get the shape but i want the cricle to be transparent and the image under it to still be visable
any1 know how i can fix this?
Hi! Is it possible to use GridLayoutGroup only on demand? What I want is just place child elements like grid cells but not like GridLayoutGroup do it by default with set dirty and calculate only on next frame
why is my textmeshpro text on button blurry
provide details/ screenshots
i feel like my toggle is kinda buggy, when i'm pressing it with a controller it sometimes doesn't press at all or when i want to toggle it on it toggles on and toggles off after a 0.1second
i am spamming A button on xbox controller all the time on this video
Is there some way to only update a layoutgroup on start, and now every frame?
I have Ui which is anchored to the corner, but when I go into maximised view, it goes out of view
how do i fix this?
show the maximized view?
Are you sure your game view window isn't just zoomed in or something?
just
found that it might be due to my animation
but either way, im not zoomed in
yep, the animation was anchoring it on the x- coord
Press T and work with the UI gizmos
I've fixed it all! Just had to re-do the animations on the new animation anchors
irritating though!
Is there a way to make a ScreenSpace - camera canvas act like a WorldSpace canvas? Essentially, i need the canvas to be the exact same dimensions as the screen and resize dynamically with the window, but I want it to be placed in the world so that the player can naturally encounter it in the game environment. Is there a trick perhaps using multiple cameras or something to achieve this functionality?
resize your world space canvas based on some camera calculations
would i just do this in an update function or are there events to detect window changes?
Pressing 'T' wasn't a suggestion to fix anything. It was a recommendation of what you should always do when working with UI
I have a empty gameobject with only a content size fitter (content) and an empty gameobject with only a layout element (Node) with preferred size & width set. When i set content size fitter to preferred size on vertical, height gets set to 0. According to my googling, content size fitter should fit to the children. Whats am i doing wrong?
if Node is an empty game obejct, there is no content on it to size from
Thought layout element would override that? either way, I added an image to node and got the same result
Thanks for the tip, Ill try that next time
What does it do?
I have an issue where when i drop an object into a object thats in a gridlayout group, it doesnt go to the right place? how can i fix this?
You haven't shown enough info. Show the inspector for ScoreMenu and HighScoreMenu
there
HighScoreMenu is exactly the same
1- Never scale UI by the transform scale, always use width/ height
2- Why does it have a mesh renderer? I think you’ve used the wrong TMP
Can we mask UI without being a child in the hierarchy? For example under the same parent, the transforms beneath will be masked by an object above them.
If you use another canvas component you can then assign the render order between them, but this creates an additional draw call. Not that big of a problem, but if you're creating something for mobile, ya have to be careful as too many canvases will affect the performance.
Hello I have a scroll view with a child that has a vertical layout group and a content size fitter, the scroll function works, but the content is visible outside of the scroll area. ive been struggling with this for a long time and don't know what I'm doing wrong, probably the most frustrating easy seeming issue that's persisted
That's handy, I'll check that out tomorrow
If you've ever needed a scrollable container of items in your Unity game menus, keep watching! Confine any number of items to the limits of a container and mask the overflow.
Learn about the different settings of the scroll view/rect as well as how to use the 'Content Size Fitter' to dynamically resize your content.
❤️ Become a Tarobro on Patr...
more canvases is better for performance
Mark and Ian from Unity's Enterprise Support team run through performance best practices drawn from real-world problems. Learn the underlying architecture of Unity's core systems to better understand how to push Unity to its absolute limits.
For more information on Unite Europe and future Unite events visit this page. https://unite.unity.com/
...
@errant egret this is the better place to ask for UI layouting.
Thx @cyan sentinel , reposting here:
Howdy folks
I'm having issues with Canvas > Scale With Screen Size
Simply put.. the UI layout looks different on each resolution. It's not scaling as I had expected 😓
Do you know any good tutorials/guides about it? What could be my mistake?
I wonder if it's because I have the Pos X / Pos Y manually set for a few of my UI elements? IMO the scaler should scale that as well 🤔
Well, if you do not set it relative to parent objects but absolute, the scaler will not know what you expect it to scale it in responsive terms
can you show like two screens of what you get and what looks wrong?
Does that mean I need to position everything through scripting?
That's any resolution with 16:9 (very simple example)
16:10 looks like this
Can you put your screen match mode to either width or hight?
like 0 or 1 instead of 0.5
Yeah, you set your stuff to absolute values, so it tried to either fit your width or height of relative points. You gotta learn how to do responsive UI, so it can scale to any size you want. Did you checkout the unity learn tutorials about UI?
Are you referring to this one? https://docs.unity3d.com/Packages/com.unity.ugui@1.0/manual/HOWTO-UIMultiResolution.html
In short, what would be the fix? That I position my elements through scripting so that I can calculate the actual distance in world vs screen point?
No no, no scripting at all
You just make them fit the parent and set your anchor min and max to work as you expect
In this tutorial, you will learn: Teach how to put Anchor buttons to sides and adjust their width and height Teach how to put Anchor UI Text to the top-center of the Canvas and adjust the screen width How to use the anchor presets to lock UI elements to corners and sides of the UI menus Teach how to use the Canvas Scaler to automatically adjust...
Hi, Im starting to use the UI and canvas in a serious project, so i need to know how to properly do things in the UI now,
My first question being how can I get my images to scale with the Canvas itself, and if there is a way to quickly see a preview of the in-game without having to Play it
Hello, I have an issue regarding TextMeshPro and Unicode displaying. This is the right channel for tmp, right? Basically, TMPro.TextMeshPro.text is modified through a script, but the unicode characters don't update. They still managed to update when tinkering through editor.
Not sure what you mean with "In-Game"? You see in sceneview what you put in the scene, so you could just use ExecuteAlways and let your code run in edit mode too, but that can be some big hassle
Sorry @cyan sentinel but that tutorial is not making any sense to me lol
I don't even have the 4 triangles anchor showing
maybe there is a functino for TMPro to update the layout on the component and rerender it?
Might be easier if I describe what im doing
Im making a quick info bar for my player with Health Ammo etc, for that I want a transparent black background and I am having trouble with setting the actual size,
This is how I would like it to look in the end, my canvas and images scale with the window size, I wanted to know how can I play with the size of that respective rectangle without having too much trouble.
There is no UI, or am I blind?
left down is a blackish rectangle
Im just starting on that
I just wanted to know how can I do that easier
without having to do this
basically playing around the scale until something looked decent
ahem
forget all that talk I just realized I can just hide my game view screen and the canvas wouldnt get squished in a bad way
You can also set your gameview to a aspect ratio instead of free aspect
That could also work, I know it might depend on some things but I assume the 16:9 is a generally good option?
Yeah, you can always use anchoring to adapt to screen sizes or full responsive design to make it fit EVERY resolution.
Couldn't find the function, does anyone have any knowledge on TextMeshPro and Unicode usage through script?
can you show your code, what you trying to do?
sure, something like this:
And what do you get?
Like you dont get back that string at all?
no, the unicode string builds correctly, and as the video shows the text gets set to that unicode string, but the unicode shows as its literal self and not the converted unicode characters
here's the attached clip
Anyone knows a platform where I can make my own simple sprites for the game?
Also, I imported a quick and dirty sprite made in paint but I can't color it, it stays the same color from paint.
sprites as in 2D?
Ohh, now i got it, sorry, missed that part.How are you setting the text there?
You are sure you included those numbers in your font of TMPro?
@"\uff0e" etc means that the strings should be treated literally, the @ character specifically tells it "don't treat these as Unicode sequences"
and you can't build Unicode escape sequences from parts
totally missed that @ part 😄
You might wanna use a lookup table / array / Dictionary to return your unicode characters instead of that number array string combine which is not gonna work
ohh
so do i do "\\uff05"?
"\uff05" doesn't work, seems like \u isn't an escape sequence
"Doesn't work" in what way?
well, "\uff05" raises an error
what error
line 5834 😬
lmao
are you sure it's that line?
so no
Like I said, you can't build escape sequences from parts. They're compile-time constants
what are parts in this context?
you cant create a new string that gets handled as a character
It has to be a constant, like "\uff05". You can't do "\uff0" + "5"
I'd use the term "easiest" instead of "ideal"
you could still use a dictionary or simple list with your custom class that holds the case as number and the character related to it and just query your list
Hardcoded values are bad practice most of the time if you can avoid it and a list of characters that could extend later is one case 🙂
thank you
but i have one more question: how come the scroll bar is beginning from the bottom instead of the top
when i run it it starts there
you have to set your textfield anchors to the correct ones so they anchor at top or bottom as you like
my anchors are set to the top center now but it still begins from the bottom
like these anchors right?
not sure if it was the textfield itself or the container holding it. Can you show both rects?
the text field as in the grid content field or the literal items inside the scroll area
It might be the pivot which needs to point on top too. Let me check real quick
thank you yeah i am unsure why this is happening
So this is my content holder
make sure this is set to 1 by default
And inside that, its just a textmeshpro field with lot of text
for some reason when i set the value to 1 and then save it, it goes back to 0
like without even running it
Did you try the pivot like on my screenshot?
apologies whats the pivot
check my screenshot 😉
i did lol
below the anchors min max? 😉
😄
my pivot on the GridContent is also already .5 and 1
the grid content screenshot
Wait, what is button choose, are those textfields?
If the value of the sidebar is at 0, it's not a pivot issue
find what is setting the value to 0
it cannot change from 0
Is your grid content setting its height correctly to fit the content?
how would one embark on that journey
i think so lol it looks right
how do you find what is affecting that
is there a method or guess and check lol
The Scrollview does that on its own if the content behaves like that.
look for references to it, what's your code doing
do you reference the scrollbar or scrollview at any point?
Yeah, thought so.
what is the height of your content container when you create those buttons?
Hi, I’m sorry to have repeated this, but I can’t solve this problem.
I am engaged in fan localization of the game similar to the Jackbox, and face the problem of TMP font, the original font - does not support the Polish language.
My created TMP font, after converted into Asset Bundle, does not work, any ideas?
this happens before buttons are made
or before it knows about buttons lol
like before i run it the value changes after i set it
Yes, because there is no content so the max value it can reach is 0
We should stop theorising 😉
For sake of testing. Create a default scrollview
Select the content gameobject, add a grid layout group and content size fitter to fit vertically, then add your prefab in edit mode until you reach the boundaries and see what the scrollbars do
man whenever i ctrl z a prefab my unity crashes
Yeah sometimes Unity can make simple things hard
where do the new buttons get added
inside code
but this time i manually added them
to check
like while it wasn't even running
I mean.. do they go below the previous ones or above
And your content rect transform is set as the one in my screenshot?
I am unsure how to answer this lol
They get added in the order of the array in the code
Without the top two check boxes you set
But I think I’ve tested those before as well
Like the control child size
The layout element dictates where the children go.
if you have it set one way it will do
123
456
another way will do
456
123
if you have it the second way, then the content is being added on top of the rest and the scrollview is growing upwards, not down
The dates look chronological lol
I’d assume it’s right
Do not assume
The joke is kinda assume I mean it shows it exactly
That it’s in chronological order
It's a drop down box on the layout element. Just check it.
What should the drop down box be
Again apologies for my lack of understanding
I still think its an issue with your anchors and pivots, but gotta go now, sorry.
Just put oin the example scrollview everything to top pivot and anchor and use a default object isntead of your prefab for testing. Go from there
i had to change the direction of the scroll bar to right to left even though its vertical im not going to ask but it works
Thanks
Hey,
I'm using "UIHorizontal" button to change the Slider component value. Everytime I press the button, the normalized value gets changed by 0.1.
Is there a way to customize this changed value, to say, 0.05?
is it possible for something to have a SortingOrder only within its context?
i.e. ive got a panel with sorted stuff and I put this panel on top of itself, i dont want the things from the behind panel to show through
I put this panel on top of itself
What does this mean
my bad i'll post a screenshot to make it clearer. So for example the green box should not overlap with the P1 pin
(im not using a Canvas btw)
i would expect either:
- they are separate canvases (which you can stack using canvas depth)
- the hierearchy looks like:
Bubble- bubble contents
Bubble - bubble cintents
.. etc..
- bubble contents
Does anyone know if there's a built-in way to make the cell sizes flexible of a grid layout element? I have a list of images underneath each other but I don't like how there is so much space around the smaller item.
You need to give the child objects LayoutElements
is there a reason why this class wouldnt work? i.e. for the inactive it returns 191, 191, 191 somehow
I don't think this solved my problem. I can't seem to find a Flexible Padding setting in layoutElements, or flexible grid size
I belive Color needs a value between 0 and 1, and not RGB colors
i also tried that but its not true
like dividing them all by 255
they all become black
These gave me pure 255,0,0 and 0,255,0
it worked after being very exact with my intentions lmao
thank you
i did not lol
I can't seem to remove the padding around the smaller icon with the LayoutElement. I imagine it has something to do with the Cell Size I define in the Grid layout (60x60), and that this is not flexible.
Hello i am inheriting from the layoutgroup but was wondering if i can somehow hide the Child Alignment option?
I can't seem to override it/find it
Does any1 know how to chance textmeshprougui text color via code
ive watched some videos however im still unsure
public class CardDisplay : MonoBehaviour
{
public Card card;
public TextMeshProUGUI nameText;
public TextMeshProUGUI descriptionText;
public TextMeshProUGUI tier;
public Image artworkImage;
// Start is called before the first frame update
void Start()
{
nameText.text = card.name;
descriptionText.text = card.description;
tier.text = card.tier;
artworkImage.sprite = card.artwork;
if(tier.name == "Rare"){
tier.color = Color.cyan;
}
}
}
this is the code im using
runs with no errors but doesnt change color
nvm i fixed it its late and my brain lagged from code lol
Hi? When I scroll and disable UI element which was clicked at start of scrolling then scroll rect jumps up. How can I fix that?
Can you show a video cause that is not clear at all
Hi
How is the intended hierarchy that needs to be setup if I want to create a bottom bar in UI that is always anchored to the left, the right and the bottom of the screen and it has a fixed height starting from the safe area (and not from the bottom of the screen)?
Do I need to script something custom to do this easy setup?
That's just one of the standard anchor presets
Could you expand the topic? anchors, as far as I know, are always referring to the parent of the transform.
But here I need to have left, right and bottom anchored to the something that have screen dimensions and the top anchored to something that has safe are diemensions
I am debating whether I should split up my UI into separate canvases or let it remain as is. I read that when a change is made on a UI element, everything on the canvas it is patented to will do some sort of refresh so splitting it up helps to make it more performant. However, i also read that when UI elements share a lot of things, they are batched to also help with performance. Most of my UI elements share the same background images and other stuff. Should I still go with the separating into canvases? Currently, there are no issues with my UI by the way.
https://cdn.discordapp.com/attachments/497874004401586176/1083793275066007652/2023-03-10_16-46-58.mp4
why isnt the button clicking?
is it because i put a button on the scroll rect or something
the event system isnt picking up any clicks
no
First thing to do, change the colours for the button states... so it is obvious when things are working
okay, i did that and nothing changed
I wouldn't expect it to change, but when it is working you'll instantly see
Why would changing the colour fix it? 🤣
idk maybe i didnt see it change 😭
the map canvas is the top most one, idk why it isnt clicking
what's 'MapOverlay' ?
ohhhh that could be it, its the beige stuff around the edges
its an image
remove raycast image
thats done it, thanks!
If I want to call a Cmd from a button click, it seems I can't set it as the On click event
public void PassPriority() {
CmdPassPriority();
}
[Command(requiresAuthority = false)]
private void CmdPassPriority(NetworkConnectionToClient sender = null) {
...
}
Is that really the way it goes? Using this dumb PassPriority function
how do i make sure an image stretches to fit any resolution?
it doesn't cover everything especially in free aspect
I'm trying to create a level selection screen, and I want the buttons to have a shadow. This shadow shows up perfectly fine in scene view, but doesn't at all in game view. Does anyone know why?
hey so i was making a quit scene in unity where when pressed a button ingame itll redirect to the main scene im using scene manager, ive put all scenes on build and the code is correct
my scene still doesnt seem to load even after ive pressed the button tho, ive even made proper buttons with it.. if anybody knows the reason why this might be happening pls do help me out..
thanks!!
make sure u have the correct scene index or name in the SceneManager.LoadScene() method
can u show the build settings
i confirmed it from #archived-code-general
does it have the correct function on the onClick event?
yup
can u show the code of it
sure
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class QuitScene : MonoBehaviour
{
public void changeScene()
{
SceneManager.LoadScene(0);
}
}
i also tried with this
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class QuitScene : MonoBehaviour
{
public void changeScene()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 0);
}
}
is your button actually responding to your click (animating, changing colors?)
Is the code running (verify with Debug.Log)?
i did a debug log but it did not respond
but in the event system it did
DO you have an event system in your scene?
but like only the eligibleToClick changed nothing showed beside the Selected option
yep
and a graphic raycaster on your canvas?
what's enabled?
the raycast target
I'm asking if you have a Graphic Raycaster component on your canvas
in the button
raycast target is important too, yes, but this is separate
oh yeah
i do
Can you show screenshots of your hierarchy and the event system inspector etc
and also what happens when you mouse over your button while the game is running and the event system is selected? Does it show your button as the mouse over target?
no the only change in event system is that eligibleToClick become true
the selected is blank
but this happens even when i click on the game screen so yeah
oh yeah and my script is attached with the menu group
so uh these are the linked things
do you think something is wrong with where ive put the script or smthin?
No much more likely something is wrong in the scene setup
perhaps another object blocking the button for example
any errors in console?
no
stupid question but you are running the game right?
i mean visually there is no such object
yeah ofc 💀
could be invisible
show your whole hierarchy
ok
here
dont tell me this is supposed to be at top 💀
it still doesnt work so
only this become true if anything is clicked
rest is well no change
lemme see
nothing is shown in pointer enter
yeah something is wrong
are you familiar with the solution?
bru why does it dissapear
bru it was too close to the camera in the z axis
Unity be like: "Yeah the elements are too close to the camera. 🤓 Don't ask why. 🤓 You have to adjust the z-axis of this 2d ui element. 🤓"
@mortal robin srry for the ping but do u think something could be up with this??
Unity is a 3D engine, always. Don't let the 2D camera mode fool you
yes but the way it works with 2d elements is still weird. Like the affect above where the ui would appear with a smaller window but not with a larger one.
I made a popup, but I'm still able to interact with other UI elements using the arrow keys. Is there a way to fix this?
hey guys! does anyone know why the 'T' letter is showing up on my text even after i press play?
I think it’s a gizmo
yes youre right!! it worked! what exactly is gizmos?
When they’re enabled, symbols show up over things like sounds and text
ah that makes sense
hey does anybody know how to get the pause screen as a seperate screen rather than as an overlay / panel? thank you
Hey, I'm SUPER new to Unity so be gentle
. I want to render an animated character sprite in a Canvas. However, when I try adding a game object with a sprite renderer, animator, etc. OR an Image with the same things, nothing shows up. Is there something that I could be overlooking?
I'm trying to create a level selection screen, and I want the buttons to have a shadow. This shadow shows up perfectly fine in scene view, but doesn't at all in game view. Does anyone know why?
You're using a SpriteRenderer which is not a UI element
Yes you must use UI elements in UI. SpriteRenderer is not UI. The Image component will work.
Hey guys how do i remove this big icon of the text?
click that to mess with gizmos
FYI - this channel isn't about editor UI
thanks, sorry about that
All of these clicks return the same position. I am trying to make my level editor inside of a scrollview, and I need to get the mouse position according to the view of the scrollview.
How can I do that properly?
If it's a screen space canvas, then no. Change it to world space.
canvases always use the size and shape of the game resolution (game view in the editor) (potentially scaled by the canvas scaler)
But if world space it won't show up in the screen
The canvas is actually colliding with my map,is that something to concern about?
no
Ok then thanks
Can someone help me? I added post processing to my game, but it doesn't work on my UI.
when building games for phones, how do you guys deal with the top bar area of the iphone 12 etc? like, the safe area literally changes
eg
This might be a helpful asset too:
https://assetstore.unity.com/packages/tools/gui/safe-area-helper-130488
It seems only these later models of iphones/pixel devices with the smaller vertical safe area. The device simulator seems to display it properly, but do most people make their game dynamically recognize a notched safe area, or do you just build with the notch in mind for all devices?
How do i get the popups to always display over the text in this ui?
I gave them a higher layer but theyre still appearing under it
the names like lake of abandon, deep wilderness etc (that you mouse over) have the text layer, 3
and the popups have layer 6
but it seems to just use the hierarchy on the left which i cant really modify. is there any other way to fix this
I guess second canvas can work if i unparent the objects but it will make the scene harder to organise
Weird that just the ui layer stuff just straight up doesnt work
What UI layer stuff
In the second image
I put the text in a lower layer than the popups but it had no effect
these are not UI layers
these are just layers
and their order doesn't mean anything for rendering
The main uses of layers, as described in this link^
physics interactions and culling masks for rendering.
Oh
Between the documentations, videos, and the forums, I'm getting some mixed messages. Next time I work my mobile game I'll have to experiment with this a bit since as I could use some optimizations for the menus.
Ideally, I would like to make the majority of my in game inventory slots their own canvas, as at the moment I actually have to use a script to change the hierarchy on stuff I drag because of the layering issues.
What is the problem of changing the hierarchy of it or just add a canvasgroup to overwrite sorting?
There's nothing necessarily wrong using a script to move ui elements throughout the hierarchy, I just remember scratching my head all day for the solution, thinking I was missing on some functionality of the canvas.
Nah, its just rendering my hierarchy on default. i use that all the time for example for UI that is anchored to a 3D world object but still scales and moves within 2d canvas, so it has the "effect" of being correctly depth calculated. Old project but been using those approaches a lot of times when multiple canvases were not an option
There's also the first point on this official Unity page to back up using multiple canvases
I have 2 images which share the same canvas (screen space camera), but each have different parents and one is tied to a layout group, yet i need to be able to overlap them visually on the screen but i am struggling to find the correct way to do so.. I am trying to use RectTransformUtility.ScreenPointToLocalPointInRectangle but im not sure if im using it incorrectly or if its the wrong functionality for this purpose entirely
Hello
I do button for pause game
When I click it the timescale = 0 and menu show
But if I click the button behind the menu I can do that
How can I solve this?
hey,
i cant get the blue dots to show up on canvas
I tried this method and it didnt work
https://stackoverflow.com/questions/37245641/scaling-issue-in-unity
Hello, i want to change some elements when a button is currently selected like when you navigate the one that is currently highlighted.
I want to make some elements change color and become visible based on the active button. I don't think the button itself has a method for this to check if it's currently the selected one, where can i possibly find this?