- Home /
Messing With Gradients At Runtime?
Is it not possible to make and use Gradients though code and/or the inspector? I really wanted to do a bunch of cool background color effects using gradients on my game. However, when I go to try and declare a new gradient, it says unknown type?
var gradient : Gradient;
BCE0018: The name 'Gradient' does not denote a valid type ('not found').
It says that Gradient is a valid type on the scripting reference. Am I doing something wrong or is that page for an old version of Unity?
If it is broken, how can I go about making my own gradient object type that would work the same way? IE, I can have multiple color transitions and I can get an rbg value from any point of the gradient.
Also, I'm not looking for shaders. I want the color values.
Answer by aldonaletto · Feb 22, 2013 at 03:45 AM
This worked for me in Unity4 - the public variable gradient appeared in the Inspector, and I was able to edit it with a double click. I don't know whether this is a Unity 4 feature, because I never used it before - are you using Unity 4 too?
Just checked and they must have fixed it when 4 came out. Thanks for the reply.
Answer by grgry13 · Sep 03, 2013 at 04:13 PM
so, this is a 'no go' for unity 3.5.7f6?
what would be the alternative?