❔ Align items Sprites in Unity
Hello I just started with Unity and I wanna create a character selection menu from scratch. Both these items have Position X on 0, why are they not aligned?
13 Replies
i want the character to be centered in relation to the Text
I thought if both have position x of 0 that should work but it doesn't
Because that is world coordinates
so what do I have to do to get the expected result?
use UI
I think I am using UI unless I missunderstand you. The text is a UI > Canvas > Text component
Sprite Renderer is not UI
If it would've been UI, it wouldn't be a Transform, but a Rect Transform
the sprite renderer is from the character sprite. The text does have Rect Transform
use Image if you want to display something on the UI
i set font size on the text to "Auto Size", looks much better now. Is it alligned now?
yeah, also make sure to set the font allignment to center, both the vertical and horizontal one, and also what was the guy trying to tell you is that: all canvas' children have a Rect Transform, you have a Transform, and for UI Rect Transforms are a life saver mainly because you can anchor/allign things easily
yeah whats confusing for me is that when I have position x 0 in the rect transform of the title and position x 0 in the regular transform of the character sprite, they don't seem to be perfectly alligned. Maybe my eyes are lying to me here
also make sure the anchor is centered
because it should be centered, unless like the image is not centered or something
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.