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 cidmodder · Mar 25, 2012 at 07:22 PM · c#color3dtext

3d text color

How do you change the color of 3d text at the start? I've tried changing the materials and using guitext but that doesn't work since it's 3d text. I also don't want it to do it onMouseEnter or anything like that I just want it to change at the very beginning. Thanks!

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

4 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Eric5h5 · Mar 25, 2012 at 07:29 PM

Changing the material is correct. A 3D text object has a renderer with a material, so you change that. Naturally you have to make sure the font matches the texture used in the material.

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 cidmodder · Mar 25, 2012 at 07:39 PM 0
Share

I was doing that but it made sort of a box behind each letter and didnt actually change the color of the font. Do i need to change the font material ins$$anonymous$$d?

avatar image Eric5h5 · Mar 25, 2012 at 08:55 PM 0
Share

You need to use an appropriate shader for the material.

avatar image
0

Answer by CreativeStorm · Mar 25, 2012 at 10:36 PM

 var infoColor : int = 0;
 
 var ColorInfo : Color = Color(0.5, 0.5, 0.5, 1);
 
 var ColorItem : Color = Color(0.5, 0.42, 0.25, 1);
 
 var ColorSpecial : Color = Color(0.25, 0.47, 0.5, 1);
 
 
 ...
 
 if(InfoColor == 0){transform.renderer.material.color = ColorInfo;}
 
 else if(InfoColor == 1){transform.renderer.material.color = ColorItem;}
 
 else if(InfoColor == 2){transform.renderer.material.color = ColorSpecial;}
 
 ...

This are snippets of a code from one of my games - i use the color of the info text to indicate faster what a message it is...

Using this snippet you can define the colors in the inspector :)

You probably should cache the transform.

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
0

Answer by Streamline Games · Nov 03, 2012 at 03:45 PM

Everyone is making this too complicated, using coding. It's simple, you make a new Material, and you change the shader to GUI and then Text Shader. you then drag this onto your text. You'll see that it goes sort of weird. So you now find your font and drag the font texture onto the material. You can now choose your color, and you're done.

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
0

Answer by NChicunque · Sep 01, 2013 at 02:22 PM

Just put the alpha to 1

var miColor : Color;

function Start()

{

renderer.material.color = miColor;

//Para que se vea el texto

renderer.material.color.a = 1;

}

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

7 People are following this question.

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

Related Questions

Changing 3DText color through C# script (non-GUI) 1 Answer

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

I want to change my 3D Text's color when mouse over. 1 Answer

Illuminating a 3D object's edges OnMouseOver (script in c#)? 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