- Home /
SetFloat doesn't work
I do a renderer.material.SetFloat("_Fresnel", 1);
but it doesn't work
What's strange is that if I do GetFloat, it returns the right value
The shader was made in Strumpy's Shader editor. I myself know nothing about shader language The code is: http://pastebin.com/q0kYRN9i
I used pastebin because this answers doesn't seem to have proper quotes.
@Johan: What doesn't work? You don't get results? $$anonymous$$aybe your shader code is wrong. Give us some more code, like the part of your shader that is using it.
@DaveA: that makes no difference; ints are cast to floats as needed.
I'm having the same problem. I can print the value just fine using GetFloat(), and edit my field in the inspector, and the new value even prints. But the value that's being used in my vertex function seems to be 0.
Anyone find a solution yet?
Answer by efge · Apr 19, 2011 at 10:16 PM
The name of the property is _FresnelPower (not _Fresnel).
Yeah I know, I just used that as an example. As I said, I can get the value just fine, but I can't set it.