As shown in the image below, I have set the text to wrap and overflow in the box, but no matter what combinations I pick, when the sentence runs long, it continues to the right and disappears from the game view. What am I doing wrong that I cannot contain the text in the box and get it to enlarge if the user keeps talking?
Asked
Active
Viewed 2,729 times
0
-
1You also have to set the `Pivot` to `X = 1` and than re-set `Pos X` – derHugo Jan 02 '19 at 07:52
1 Answers
0
Set horizontal overflow to Wrap, vertical to Overflow, and Size fitter's vertical fit to Preferred size. By modifying width of element, you decide which sentences are considered "long". Long sentences will be wrapped, and size fitter will change the height of the element.

trollingchar
- 760
- 2
- 6
- 18
-
Thanks for this. I have done the settings as you suggest, and the width of my text element keeps it in view, with my middle-right anchor, but when I run the app, anything longer than fitting in the element still spills over to the right and leaves the game view. I updated the image in my original question. Can you please see what I am doing wrong now? Many thanks – Jan 01 '19 at 11:44
-
1By setting horizontal fit to **Preferred size**, you let the content size fitter change the width of RectTransform (you see, now you can't change width by hand as its field is no longer interactable). Leave it **Unconstrained** instead. BTW, in my test project it didn't unlock when I set the right value back and even remove the fitter component, yet another bug in Unity. Removing the game object and creating a new one worked. – trollingchar Jan 01 '19 at 18:37