Hey everyone, so, unfortunately for me, I still wasn't able to fix the issue of text "leaking" out of the popup. Due to the fact that I'm struggling with this problem for couple of days by now, I think that making a thread so that my issue doesn't get mixed up with other UI related questions. So, this is how the thing currently looks like:
#text leaking out of the popup
1 messages · Page 1 of 1 (latest)
I literally wrote the introduction to my problem and discord decided "eh, screw this guy". Well, I guess I will just describe it once more
This is how my popup currently looks like:
As you can see, the text is clearly leaking out of the popup.
The structure of the popup in question:
Any kind of help would be appreciated ❤️
Showing just the hierarchy isn't very useful
What components are on those things
This is the way to do it. Probably doesn't work because you've missed something
When working with UI, press T and use the UI tools
You need to sort out the layout/alignment properly now. On the 'destroy' put a LayoutElement component and tick the ignore flag .. this will allow you to have it under the vert layout group and put it wherever you want
Tick 'Control Child Size' height on the vert layout group
@wintry portal (I hope you don't mind being pingged)
You need to look at the settings, the anchors, the padding
In your screenshots, you snip off all the info that is useful
Sorry I didn't answer, was at school
here
I mean, tbh on the text object there is nothing attached
here's the popup image though
UI scale should ALWAYS be at 1,1,1
weird thigns start happening when you don't do that
you also don't have it anchored to any specific part of the canvas
let's just say it's a way too big at 1,1,1
Is it worldspace UI?
I see it is from one of your earlier screenshots
ALL UI elements should be at 1,1,1
the parent can be what you resize to make it accurate
I normally have an empty gameobject, and set the scale to 0.02 on that
it is worldspace UI, yes
good idea
is there any specific part I should anchor?
Like
for the popup, probably the center will do
I don't know what you're sharing..
you sent a screenshot of the popup layout element + image.. then a rect transform without saying anything...
\
nice
I find it strange that the text is outside of the recttransform
But anyway.. set these values to what looks right
ok, so set it's anchor to be bottom right..?
ok and now text is being messed uup again
it changes it's position depending on the popups position in the worldspace\
without a screenshot it doesnt make sense
however, I noticed.. Z should be 0
for all child elements of the canvas, Z should be 0
just toggle the popup gameobject off/on and see if anything changes
for some reason it isn't
AFK
yeah, because you have set them to not 0
I did
ah the code changed the Z
alright, I will continue later, gotta do homework
just in time before 24 hour mark
well, the issue was still not resolved
@wintry portal another problem
var Rect = image.GetComponent<RectTransform>();
image.SetActive(true);
Rect.position = new Vector3(objectHit.position.x, col.bounds.max.y + 1.5f, 0);```
still doesn't work
"doesn't work" isn't a descriptive problem. Explain better
don't use position
https://docs.unity3d.com/ScriptReference/RectTransform.html
so yeah
I would answer quicker if I didn't have to ask for stuff all the time
you've got that issue, it's obviously something code related... where's the code?
ok I got it bigger, had to scale it up, it just doesn't move
well it does
but slightly
barely noticable
InteractionRadius fetchData = objectHit.GetComponent<InteractionRadius>();
var col = objectHit.GetComponent<BoxCollider>();
var Rect = image.GetComponent<RectTransform>();
image.SetActive(true);
Rect.anchoredPosition = new Vector3(objectHit.position.x, col.bounds.max.y + 1.5f, 0);```
I think perhaps I've misunderstood what you were doing with this
what's image ? I assumed it was Image image .. but is it the popupParent GameObject?
no it is not, it's an image
so uh, @wintry portal ?
well