Search Unity

Question Text Mesh Pro with Content Size Fitter and Auto Size

Discussion in 'UGUI & TextMesh Pro' started by SoDynamic_, Mar 30, 2021.

  1. SoDynamic_

    SoDynamic_

    Joined:
    Mar 5, 2014
    Posts:
    3
    Hello,
    I'm trying to set up a Text Mesh Pro text element with content size fitter. This is easy, adding a content size fitter to the text object and setting horizontal fit to preferred size works perfectly. Here's my problem:
    Once my text mesh pro object becomes as wide as it's parent element, I'd like it to stop getting wider and use the auto size function to make the text get smaller to accommodate. I've tried using layout element, but it doesn't seem compatible with content size fitter, as it forces it to always be wider than the text.
    Thank you for any help you can provide.
     
  2. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    I think combining both is not really possible (maybe with some hacky scripts)...
    why can't you just make the size of the Text as big as the parent and remove the content size fitter? What is the greater goal you want to achieve?