• 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
5
Question by Master_Davicous · Apr 29, 2016 at 07:37 PM · gameobjecttextcubetextmesh

Putting text on a 3D object?

In my scene I have a table that Instantiates a bunch of pieces of paper (thin cube objects) and I wanted to put randomly generated text on the paper... The problem is when I looked up how to do it, people said to put a Text Mesh on the object, but it doesn't work. A popup says "Can't add component 'TextMesh' to Paper because it conflicts with the existing 'MeshFilter' derived component!"... Any help?

Comment
Add comment · Show 2
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 rodude123 · Apr 29, 2016 at 07:50 PM 1
Share

Try making a sprite with the text on then adding it to the whole cube

avatar image Namey5 · Apr 30, 2016 at 10:39 AM 0
Share

You'd have to create a new object as a child if you were going to do that.

3 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by Jacky-Marley · Dec 01, 2016 at 10:08 AM

or you can add another canvas on World space render mode, you give it the size of your paper and you can add UI stuff on it (I currently do it with a computer 3D model)

https://docs.unity3d.com/Manual/HOWTO-UIWorldSpace.html

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
avatar image
2

Answer by BeRee · Nov 30, 2016 at 10:41 PM

Also had this Problem. Add a Script. There you can make a new GameObject and assign a TextMesh.

 GameObject text = new GameObject();
 TextMesh t = text.AddComponent<TextMesh>();
 t.text = "new text set";
 t.fontSize = 30;

Than you can position that Text like that.

 t.transform.localEulerAngles += new Vector3(90, 0, 0);
 t.transform.localPosition += new Vector3(56f, 3f, 40f);
Comment
Add comment · Show 1 · 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 christoph_r · Nov 30, 2016 at 10:51 PM 0
Share

Similarly, you could also user Unity's UI text. This usually gives more aesthetically pleasing results.

avatar image
2

Answer by codemaker2015 · Oct 19, 2020 at 05:45 AM

You can do that with a UI Text game object and the 3D Object.

The steps are as follows:

  • In your empty scene, create a 3D Cube.

  • Create a UI Text object.

  • Drag the Canvas to become a child of the cube.

  • Set the Canvas to World Space render mode, remove the Canvas Scaler component and set Width = Height = 1 and all Pos = 0.

  • Set the text Width = Height = 100, all Scale = 0.01 and Pos Z = -0.5.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

9 People are following this question.

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

Related Questions

Insert 3d text to the front face of a cube GameObject 0 Answers

Generating Random Numbers on a Game Object 1 Answer

Quest Script Help 2 Answers

Why is text ui cant be static ? 0 Answers

How to setup TextMesh Pro Font Asset to include characters from all languages? 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