Hello, I am trying to have my 3D Text in my game flicker. I have a script that has my lights flicker and I tried modifying it to fit the 3DText and it keeps coming up with the error: “NullReferenceException: Object reference not set to an instance of an object”
Here is my code
var GuiText1 : GameObject;
function Update ()
{
if ( Random.value > 0.9 ) //a random chance
{
if ( GuiText1.Renderer.enabled == true ) //if the light is on...
{
GuiText1.Renderer.enabled = false; //turn it off
}
else
{
GuiText1.Renderer.enabled = true; //turn it on
}
}
}