I am trying to fade consistently fade a Line Renderer by adjusting the color property of it's material. I got the code I'm using from the accepted answer to How can I fade a game object in and out over a specified duration?. When I used the Default-Line material for the line renderer I got the following error:

Assertion failed: Material doesn't have a color property '_Color' UnityEngine.Material:get_color()

When I used the Default-Diffuse material, nothing happened.

Finally, when I used the Sprites-Default material it worked perfectly.

How can I make the line renderer fade out consistently based on different material?

  • \$\begingroup\$ "Finally, when I used the Sprites-Default material it worked perfectly." So, is your problem solved? Was there something about using the Sprite material that was not "consistent" in the way that you want? \$\endgroup\$ – DMGregory Jan 31 '18 at 13:04
  • \$\begingroup\$ @DMGregory I want the fade code to work with all materials, for example it's not working with the Default-Diffuse. \$\endgroup\$ – OnlyCodeMatters Jan 31 '18 at 13:34
  • 2
    \$\begingroup\$ That won't happen. Not every material does alpha blending with the pixels behind it. Default-Diffuse is an opaque material — changing its alpha would not render it translucent. \$\endgroup\$ – DMGregory Jan 31 '18 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.