Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

How to put text on the scene, like with the old 3d text?

Discussion in 'UGUI & TextMesh Pro' started by Kescay, Dec 4, 2014.

  1. Kescay

    Kescay

    Joined:
    Oct 6, 2013
    Posts:
    7
    I have a lot of button-like elements on a scene, and on top of each button, there needs to be a number. In the old unity, I would just slap 3d text-objects on top of the buttons, but since 4.6 doesn't seem to have 3d text, what is the best way to do it?

    I noticed I could add a canvases on top of the buttons, and insert the text there, but I have hundreds of buttons on screen, and on first thought it feels bad for performance to add 100 or so canvases on the scene.

    Is it?

    I also noticed that I can add a "Text component" on the button gameobject, but I cant get this to work - I cant see the text anywhere. I cant find any documentation on how to use the ui components on gameobjects, and now I'm not sure what's the best way to do this.

    Thanks
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    It hasn't been removed.

    --Eric
     
  3. Stephan-B

    Stephan-B

    Unity Technologies

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    The old Text Mesh is still available via the Add Component button Mesh > Text Mesh. There are of course better alternatives to using TextMesh.

    For text in a scene, I would not use the Canvas system and stick to either TextMesh or of course use TextMesh Pro.
     
    Kescay likes this.
  4. Kescay

    Kescay

    Joined:
    Oct 6, 2013
    Posts:
    7
    Thanks. That works. Add an empty gameobject and give it a text mesh component.

    Eric5h5, I cant find the 3d text anywhere in my 4.6.0f3.

    And trying to give gameobjects the 4.6 text component seems to just open a can of bugs..
     
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    As Stephan B explained. There never was a "3D text object" per se, it was always a GameObject with a 3DText component. That's how absolutely everything in Unity works...components attached to GameObjects. It works exactly the same as before, no bugs that I know of. In pre-4.6 versions of Unity, there was a menu item that created GameObjects with a 3DText component attached, but that just made it a bit more convenient to create; it doesn't change how it works in any way.

    --Eric