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 ddulshan · Feb 14, 2015 at 09:57 AM · animationmateriallight

Changing Material in Animation

I have a light Bulb that goes off eventually through Animation. It has a Illuminated Material, I need to change the Material when the light goes off in Animation. How to do it?

I have both the Illuminated and off materials.

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 kbaloch · Feb 14, 2015 at 11:33 AM 0
Share

can you explain this, materials are used for bulb ?

avatar image ddulshan · Feb 19, 2015 at 12:14 PM 0
Share

I mean I have a Bulb $$anonymous$$odel, and assigned a Illu$$anonymous$$ated $$anonymous$$aterial to it. I need to change the Illu$$anonymous$$ated material through Animation.

avatar image kbaloch · Feb 19, 2015 at 12:24 PM 0
Share

https://www.youtube.com/watch?v=z$$anonymous$$l8bl-mCdU

is this helpfull are you want something else?

2 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by CalebBennetts · Dec 10, 2020 at 04:49 PM

@ddulshan Well, five years later, but here's finally an answer. 1. In your animation timeline, add the property "Mesh Renderer" -> "Material Reference." 2. (optional) You may need to pull your "Project" tab into a new window so you can see both your list of materials and your animation timeline at the same time. 3. Click and drag the material you want from your list and drop it in the animation timeline.

Hopefully you figured something out and weren't trapped in developer limbo all this time, but I thought I would post in case anyone else has a similar question.

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
2

Answer by kbaloch · Feb 19, 2015 at 12:44 PM

1) start your animation 2) change your material using this

 if( renderer.material == material1 ) {
      renderer.material = material2; 
 }
   
 else  {    
 renderer.material = material1;
 
 }



Comment
Add comment · Show 4 · 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 ddulshan · Feb 20, 2015 at 12:37 PM 0
Share

Thanks. But I don't know how to change during some time. I mean my bulb's light is Flickering through anim. So it changes eventually. How to trigger this At those times? Boolean?

avatar image kbaloch · Feb 20, 2015 at 01:27 PM 0
Share

if do you think you find clue about your question then accept the answer for others benefits.

avatar image kbaloch · Feb 20, 2015 at 01:28 PM 0
Share

what do you mean by some time ? can your explain what you want ?

avatar image ddulshan · Feb 20, 2015 at 03:21 PM 0
Share

I have an Anim clip attached to the Light, where the light is turned off eventually(for flicker effect). How do I change the $$anonymous$$aterial between these times(flickerings).

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

What is wrong with my shader? 1 Answer

AnimationEvent has no function name specified 2 Answers

Sprite animation from 2D to 3D 2 Answers

Can a 2D skybox be animated? 0 Answers

How do I link/animate a light with a shuriken particle system? 2 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