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 a1468155 · Feb 24, 2014 at 01:16 AM · texturetextcolor

3D Text Object does not change to the color specified on Mouse Over

Hello. I am currently working on a menu using 3D text, and I have a script on the object that changes the color of the text from yellow to red when I mouse over the object:

   function OnMouseOver () 
      {
         renderer.material.color = Color.red;
      
     }

Unfortunately, for whatever reason I seem to be able to get only 3 different colors for the mouse over: red, green, and black. Whether it's by entering the name of the color, or by grabbing the RGB values. Example: (150,100,25,255)

Is there something in the inspector I need to be setting differently to get the full range of colors available?

Thank you.

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 robertbu · Feb 24, 2014 at 01:21 AM 0
Share

I'm not sure where the disconnect is. How the color is handled (or if it is handled at all) is up to the shader. $$anonymous$$any shaders use the color you provide as an overlay color on the object, so the color you get is actually a combination of the color you specify and the color of the object.

One issue with your question is your use of:

Example: (150,100,25,255)

The Color class in Unity uses values in the range of 0 to 1 for all components, so you would not be setting values that you specify. So you would specify a specific color in code like:

 var color = Color(0.6, 0.4, 0.1, 1.0);

There is a Color32 class in Unity that handles colors components in the range of 0 - 255, but renderer.material.color does not use it.

avatar image a1468155 · Feb 24, 2014 at 08:22 AM 0
Share

Thank you, I think I have a much better understanding of how that system works now. I'm still having trouble getting Yellow text to change to White, but this is a good place to start.

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.

Follow this Question

Answers Answers and Comments

19 People are following this question.

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

Related Questions

How do I change the font and color of GUI text? 1 Answer

How to color text smoothly or how to color part of a letter? 1 Answer

new Color() not working properly? 1 Answer

How to create a texture, fill it with some color, add a text at a center and to set this texture to some object in C#? 0 Answers

How do I change the font and color of GUI text? 0 Answers


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