Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

¶ added to input fields

Discussion in 'UGUI & TextMesh Pro' started by StefanAugmentors, Nov 1, 2018.

  1. StefanAugmentors

    StefanAugmentors

    Joined:
    Nov 3, 2017
    Posts:
    15
    When ever I input text into TMP_InputField an invisible "¶" gets added at the end.

    Below is the settings on the input field.

    Screenshot_147.png
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    Is it because you press 'enter' to finish editing the input field? If you know you'll never want that formatting mark, try trimming it off the string when the input field loses focus, or when you are about to use the string.
    Code (CSharp):
    1. inputField.text = inputField.text.TrimEnd('\r', '\n');
     
  3. StefanAugmentors

    StefanAugmentors

    Joined:
    Nov 3, 2017
    Posts:
    15
    Yes I press enter on the mobile keyboard. I added trim to the string before sending it off to the server. However I'd like to know if there's a setting to stop it adding that formatting mark.