TextArea(2,6) not limiting to maxlines

The ‘string question’ Serilazefield variable does not seem to limit the number of lines in the Unity Editor when using the [TextArea(2,6)] meta tag. The text area is created in the Editor but when more than 6 text lines are added a vertical scroll bar is added to the text area field and you can keep adding more text lines.

Blockquote
[TextArea(2,6)]
[SerializeField] string question = “Enter new question text here”;

I am using Unity 2021.3.29f1

question

Looking further into this and reading the documentation the behaviour is correct and the lecturer description is incorrect. The limit is just the number of lines used in the editor to accept the text - it does not actually limit the number of lines you can add.

maxLines The maximum amount of lines the text area can show before it starts using a scrollbar.

Solved

Hi RedSandman,

Thanks a lot for pointing this mistake out. I’m forwarding it to Rick.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms