• 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 WiseAX · Dec 27, 2016 at 05:14 AM · textmeshborder

Stylized border around TextMesh

Hey All. I'm new to Unity and am re-familiarizing myself with C#. I guess this is a 'What's the best Unity approach?" sort of question.

I'm working toward a 3D point/click (FPS without the 'S') type of interface. I'd like certain objects (signs, documents, photos, etc) to offer the player an option to expand a 2D "window" in 3D space for closer inspection without restricting player movement (as opposed to locking player controls, displaying an overlay then requiring a click to exit the "inspection").

I currently have a script that will create a new 3D Text (TextMesh) object, display some text (and wrap it at a specified width) then LookAt the player as he/she moves about (see 1st image below). This behavior seems to work pretty well.

alt text Working: creates TextMesh and looks-at/follows main camera

However, I'd like to surround the text/content with a border and semi-transparent background that will size to its contents to set it apart from other world objects.

alt text Faked: Stylized border with semi-transparent background

I've done quite a few searches for something similar but my terms always seem too similar to other Unity subjects. I apologize if this has already been addressed.

Any advice on best practice or even a point in the right direction is appreciated. Thanks!


'Thank You!' to everyone here at answers.Unity3d. Your answers are all over my project :)

3dcaptionbefore.jpg (74.4 kB)
3dcaptionafter.jpg (80.7 kB)
Comment
Add comment · Show 3
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 AlwaysSunny · Dec 27, 2016 at 05:16 AM 1
Share

Is there a very, very good reason you aren't using a canvas and UI elements to create your UI? This would be very simple in that scenario.

Depending on how sophisticated you want the effect to be, it could become quite complicated without relying on these tools, but certainly possible if you absolutely must.

avatar image tkamruzzaman · Dec 27, 2016 at 05:26 AM 1
Share

Ins$$anonymous$$d of using Text$$anonymous$$esh, you should use 'world space' Canvas with a semi transparent Images, Texts and what not.

avatar image WiseAX · Dec 27, 2016 at 05:40 AM 0
Share

Perfect! Nope, not even just a good reason :) only that I assumed the canvas/UI system had limitations in 3D space. Thank you both!

0 Replies

· Add your reply
  • Sort: 

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

6 People are following this question.

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

Related Questions

Smart way to add border to a text mesh in a 2d environment 1 Answer

3DText with outline 0 Answers

Playernames on top of the gameobject on a text mesh 1 Answer

3D Text fading out 2 Answers

GUITexture and text mesh 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