- Home /
How to reference a property of a custom texture?
I am lerping the color of a cube when i click on it. I am using MK Glow Free asset to produce a neon glow to the cube. The lerping of the cube color works fine but the neon color remains the previous one. There is a glow color property on the neon glow texture. How do I reference that glow color property so that i can lerp that too?
Answer by JedBeryll · Dec 16, 2017 at 09:05 AM
Get with material.GetColor and set with material.SetColor. The actual color name is usually not the one shown in the editor, rather something like "_Glow" but you can check the shader code (or maybe the MK Glow Free description) for the real name.
Answer by abhaychandna · Dec 16, 2017 at 09:49 AM
Yeah that did it. I wouldn't have figured out that the variable name is separate and is written in the shader code.Well, you learn something new every day. So thanks for that. One more thing, there is also a glow power value of the type range which i want to reference through the script and i can't do material.setRange or something. So how do i reference that?
Never$$anonymous$$d. I found the answer. I needed to use material.getFloat("name",value);
Your answer

Follow this Question
Related Questions
C# Children of GameObject has it's script disabled after SetActive(false) and SetActive(true) 1 Answer
My raycast wont function properly 0 Answers
How to create a score manager script involving awarding points from multiple objects? 2 Answers
can some 1 help with my script. im making a wood cuting script. 0 Answers