0
\$\begingroup\$

I have a very simple scene setup. What I want to do is to create a button prefab composed of a sprite and a TextMeshPro object. When I group the sprite and the text under a GameObject, the pivot of the compound object appears very far from the center of the GameObject (please see the attachment).

I can't move the pivot of the text to the center no matter what I do.

Is this an expected behavior?

enter image description here

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

I think you should've created a Canvas first and then create the icon and label, then make an empty object align it between the two objects(icon & label) then drag it under the empty gameobject.

enter image description here

\$\endgroup\$
3
  • \$\begingroup\$ Thanks for the help. I'm creating a word game and there'll be lots of text on the screen at a moment. So does this mean I have to put Canvas objects everywhere? \$\endgroup\$ Oct 19, 2018 at 17:07
  • \$\begingroup\$ @Élodie Petit for UI related things you only need one canvas. If that's troublesome for you, Text objects can also be a viable option \$\endgroup\$
    – user115399
    Nov 18, 2018 at 17:10
  • \$\begingroup\$ @GabrieleVierti That's how I handle the text objects now, thanks. \$\endgroup\$ Nov 19, 2018 at 5:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .