Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 yosh · May 30, 2011 at 11:01 AM · animationcoloritween

iTween: How to animate other shader-color values besides the main Color?

Hi,

is it possible with iTween to tween other Shader-color values like "_SpecColor" or "_ReflectColor" or any custom shader values? The current tween parameters like "ColorFrom/ColorTo/ColorUpdate" only edit the MainColor..

For example i use Ani.Mate for tweening like this (but would love to use iTween only):

 meshArray.renderer.sharedMaterial.SetColor("_SpecColor", Color.red);

Thanks for any help on that.

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

1 Reply

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

Answer by tiagomelobr · Aug 03, 2011 at 02:00 AM

I don't know if this is still needed, but I've searched in many places and didn't find an answer.

You need to change the iTweenScript to be able to handle this. Is a small change, just add "_TintColor" to the NamedValueColor enum. It should be like this:

 public enum NamedValueColor{
         /// <summary>
         /// The main color of a material. Used by default and not required for Color methods to work in iTween.
         /// </summary>
         _Color,
         /// <summary>
         /// The specular color of a material (used in specular/glossy/vertexlit shaders).
         /// </summary>
         _SpecColor,
         /// <summary>
         /// The emissive color of a material (used in vertexlit shaders).
         /// </summary>
         _Emission,
         /// <summary>
         /// The reflection color of the material (used in reflective shaders).
         /// </summary>
         _ReflectColor,
         _TintColor
 
     }

After that, just use ColorTo normally:

 iTween.ColorTo(gameObject,{"a": 0.3,"time":1,"namedcolorvalue": "_TintColor", "loopType":"pingPong", "easeType":"easeInOutQuad", "includeChildren":true});
Comment
Add comment · Show 3 · 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 tiagomelobr · Aug 03, 2011 at 02:02 AM 0
Share

I've forgot to remember you, you need to change "_TintColor" for whenever value you like!

avatar image austinj · May 15, 2012 at 03:17 PM 0
Share

Hey everyone, thanks in advance for all the help.

This seems to address exactly what I am having trouble with, the only issue is that I am using the iTween Visual Editor and am not able to use ColorTo as referenced above. Im not a programmer, so the Visual Editor has been great for creating all the animated color shifts, I just cant get it to change my particle colors.

Do you know how I can add _TintColor to the iTweenEvent script so that I can change the Tint Color of Particles using the iTween Visual Editor rather than calling it from a script? Ive been digging around in all the iTween scripts to no avail.

Thanks, Austinj

avatar image justinl · Aug 01, 2013 at 10:40 PM 0
Share

Thank you thank you thank you tiagomelobr. That's exactly what I needed (modifying the NamedValueColor enum).

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Legacy animation system cannot animate colors? 3 Answers

iTween.ColorTo on one material 1 Answer

Move Towards Target Color 2 Answers

Custom Easing Types using Curves for Motion? 3 Answers

Set the procedural color texture script to a set pattern? 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