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 Team_26 · Jul 03, 2014 at 08:10 PM · animationmaterialbugcoloralpha

Can't animate Material.Color properties

Hi! I've got an object fade out animation and it's working fine on Animation Type 2. But on this type it's playing automatically and I can't edit it. But when I mark it as legacy it the color properties aren't work (when I animate other properties, transform.position for example all is working fine).

I'm not sure that it isn't the bug (Issue Tracker Link).

Please help if you know what I'm doing wrong.

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 Team_26 · Jul 04, 2014 at 09:07 AM 0
Share

No solution? :(

avatar image Team_26 · Jul 04, 2014 at 04:30 PM 0
Share

STILL NO REPLY!!!!

3 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by musaranya · Jul 05, 2014 at 09:42 AM

For animating the color property of your objects you can do the following:

  • select the material used by your object in order to see its properties in the inspector

  • at the right of the shaders dropdown click on the Edit button. It will open the shader source code in your code editor

  • look at the top of the code, there are the properties used by the shader. For example if a shader shows in the inspector a property called Main Color, you will see something like this in the source code: _Color ("Main Color", Color) = (.5,.5,.5,1)

  • in order to change this Main Color property from your script, you should do something like this renderer.material.SetColor("_Color",yourColor). As you can see you must submit to SetColor() the name of the property according to the source code of the shader

  • you also can lerp this color for enhancing visuals, it's easy and free using iTween :)

Hope it helps

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 Team_26 · Jul 05, 2014 at 05:32 PM 0
Share

Thanks. I use iTween and it solved my problem ;)

avatar image
0

Answer by flaviusxvii · Jul 04, 2014 at 05:41 PM

Here's how I tackled changing color over time. Hope it helps.

http://pastebin.com/YwQmjatq

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 Team_26 · Jul 04, 2014 at 07:39 PM 0
Share

Sorry, but I;m searching for hint, not for complete script. However I want use this, but I don't understand it and I've got a problem: $$anonymous$$aterial doesn't have a color property "_TintColor".

avatar image flaviusxvii · Jul 04, 2014 at 10:03 PM 0
Share

I usually don't provide full scripts.. and I considered this one a hint because I was pretty sure you couldn't just use it directly. It was meant as a guide. I use a material where the color is called "_TintColor". You'll want to change that to whatever matches the material you plan to use. Or you could make a variable you could fill-in in the inspector.

avatar image
0

Answer by EpicCubeGroup · Oct 17, 2016 at 08:07 AM

To simply animate colors over time (for ANY material property), you could consider to use Color Transition Package. We've implemented a set of components that allow users (artists and programmers) to simply create color animations from editor and from code. Here it's the link to the official page: http://alexandros.altervista.org/blog/color-transition-package-for-unity-3d/ and to the Asset Store: http://u3d.as/Bmr bye

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

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

Related Questions

Changing two different objects renderer colour 1 Answer

Material doesn't have a color property '_Color' 4 Answers

Fade out a material that has a texture 1 Answer

Array breaking when pushing floats into it via a for loop. 2 Answers

Editing alpha through a script and animation changes the colour not the transparency? 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