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 PushpaK · Nov 28, 2012 at 08:02 AM · materiallerpchange material

renderer.material.lerp() doesn't work in unity

Guys,I'm using unity 4 version. I just copy and past code from unity reference to lerp the material but it isn't working; When I print current material it prints preassigned material. Is there any change in unity 4 to lerp material?

Comment
Add comment · Show 7
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 Tim-Michels · Nov 28, 2012 at 09:04 AM 0
Share

material.Lerp doesn't change the material itsself, it only Lerps between the properties of two material.

avatar image PushpaK · Nov 28, 2012 at 09:30 AM 0
Share

But the code does work. It should lerp between two materials at least.

avatar image Tim-Michels · Nov 28, 2012 at 09:36 AM 0
Share

No it will only animate the material properties. The object will always keep its preassigned material, by Lerping you only animate the material properties (color, specular color, shininess, ...)

What you're trying to achieve is probably a smooth transition between two totally different materials. That will require a custom material with support for that kind of effect.

Just remember that material.Lerp only changes stuff like color, shininess, ... The assigned material of the object doesn't change.

avatar image TurboHermit · Nov 28, 2012 at 09:40 AM 0
Share

The unity docs imply that you can though,

http://docs.unity3d.com/Documentation//ScriptReference/$$anonymous$$aterial.Lerp.html

avatar image PushpaK · Nov 28, 2012 at 10:07 AM 1
Share

Can we lerp between two textures with same material ?

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Paulius-Liekis · Nov 28, 2012 at 09:45 AM

Lerp only interpolates properties of the material. Nothing else.

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

13 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

Related Questions

Burning Effect Lerp Not werking 2 Answers

how to switch material with script? 1 Answer

change material rendering mode, but don't update material seems in scene at runtime 2 Answers

Material.Lerp for transparent spec material with two different textures 2 Answers

Lerp material opaque to transparent 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