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 MaG3Stican · Feb 18, 2015 at 09:49 PM · uitexteffects

How to get the individual characters of a TextMesh?

Hello, I want to make a very simple effect with my text were all the letters in a text move randomly. I saw that if you use the TextMesh component to render your text, it cuts every character in your text into individual rectangles, is there a way I can get those rectangles so that I can move them around?

Thank you.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Noah Dyer · Feb 18, 2015 at 10:48 PM

You cannot access the individual characters in a single text mesh as individual objects and manipulate their transforms.

To accomplish what you want, I would do 1 of 2 things:

1) If I want the moving to be fluid, I would have each letter be a separate gameObject/TextMesh component, and create a class to hold the intended phrase, the letters of the phrase as separate gameobjects, and animate the gameobjects as desired.

2) If by move randomly you mean some kind of scrambling, and the scrambling can happen in flash, you could just change textMeshComponent.text in an update;

Comment
Add comment · Show 2 · 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
avatar image MaG3Stican · Feb 19, 2015 at 08:15 PM 0
Share

The first option seems overcomplicated since depending on the font size I will have to calculate the spacing between letters..I am still trying to get the mesh of the teshmesh..thank you anyways.

avatar image Noah Dyer · Feb 19, 2015 at 08:49 PM 0
Share

The answer is correct, even if you don't like it ;) Please mark it as such, though you are certainly not obligated to use my workarounds, just trying to be helpful.

Unity simply creates a billboard based on the information you supply to text mesh. Once you get it back, it doesn't even know where an individual character is in the billboard, much less does it know and give you power to manipulate the billboard in a way that can be accessed on a per character basis.

To get the functionality you want without managing multiple text meshes as I've suggested, you would have to create your own class to replace Text$$anonymous$$esh, which would first need to handle the job of building individual character billboards from scratch based on font info and the supplied string (what Text$$anonymous$$esh does now for free), and stores each character's billboard in a way that allows you to easily and intuitively manipulate the individual characters as desired (what you want, but Text$$anonymous$$esh cannot be made to do). That seems overcomplicated.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

UI Text compression on android 1 Answer

Replacing transparency of text with a solid color? 1 Answer

Layout group children adjust to content 1 Answer

Why does my game look different in Bluestacks then it does in unity? 1 Answer

UI Text.LineSpacing doesn't work when the Text has only one line ? 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