Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by MatrixBai · Sep 24, 2013 at 02:56 PM · text

Can TextMesh support multiline text?

I tried to set multiline text to a TextMesh, but nothing happened.

 TextMesh textMesh = GetComponent<TextMesh>();
 textMesh.text = "Hello\nWorld!";

Can TexhMesh support multiline? Is there any way to solve it?

Thank you.

EDIT:

Thanks for the spell checking :-)

The actually thing I did is a little complicated.

I load a csv file from internet (Google Drive), and parse it into json files for localization. After I found the newline symbol is missing and can't make a newline in Unity3D editor, thought the TextMesh don't support multiline text. I know I was wrong now. The problem is in the parse.

Is there anyway to close this question, or should I delete it?

Comment
Add comment · Show 6
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eric5h5 · Sep 24, 2013 at 03:24 PM 2
Share

It works fine, as long as you spell "GetComponent" correctly.

avatar image Fattie · Sep 24, 2013 at 04:09 PM 1
Share

it's a shame one couldn't buy those misspellings and put advertisements there, like with the WWW

avatar image Eric5h5 · Sep 25, 2013 at 04:18 AM 1
Share

Define "nothing happened". The text is on one line? You don't see any text? Or what? As I mentioned, it works fine.

avatar image clunk47 · Sep 25, 2013 at 04:46 AM 0
Share

I'd say so long as you don't spell Text$$anonymous$$esh like Texh$$anonymous$$esh? Shit. I know it's a type-o but I have to jump in on something that Eric and Fattie have both commented on lol XD

avatar image Eric5h5 · Sep 25, 2013 at 04:52 AM 1
Share

Well, that's not actually in the code so it doesn't count. ;) Typos in actual code are far more important....

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by jpatinop80 · Aug 22, 2015 at 03:10 AM

try this text=text.Replace("\\n","\n");

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Mirrored text for mirror projection 0 Answers

How to save script component variables at runtime from IOS device? 1 Answer

Is it possible to italicise GUI text without having italic font? 1 Answer

How to Instantiate an editable text field 0 Answers

Using Text file with .JS code written on it in webplayer? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges