[Beginner] [UI text] Adapt the size of the text zone to the text inside

Hello the community !

Well I create an image to explain what i try to do :

I find a lot about content size fitter and Horizontal layout group but it’s not work. I work on a script to change the size manually with the number character of the text but maybe he exists a better solution with the unity tools ?

Thx for all readers

its not that hard:

  1. add a panel
    Imgur: The magic of the Internet
  2. scale the width of the panel as you favor
    Imgur: The magic of the Internet
  3. add the components like here: Imgur: The magic of the Internet
  4. use the bottom middle anchor preset with shift and alt pressed
    Imgur: The magic of the Internet
  5. add a child “text” gameobject and fill it with your text

Thx Soraphis,

Sorry for the late answer.

I try it a first time but doesn’t work. But I think it’s the good path.