- Home /
Mesh render flicker
Can someone help me with mesh render flicker ? this is what Im working on at the moment http://i.imgur.com/kGSVG8F.jpg and the point is to make the 7 in " 24 / 7 " to flicker, to get that working I need a script that randomly turns of mesh render and then turns it back on agein. It would be amazing if someoen cud give me a helping hand
Please do a search for these kinds of things before posting a new question, this has been answered hundreds of times before on the forums and the answers site. This is one of many: http://answers.unity3d.com/questions/34739/How-to-make-a-light-flicker.html
I did search around for it alot but didnt find anything it is becouse I wasnt looking for a light flickiring. what you see in the picture is a mesh with particles-additive shader on to get that glow no lamp
Answer by felixfors · Feb 10, 2013 at 04:32 AM
using UnityEngine;
using System.Collections;
public class Flicker : MonoBehaviour {
public float flickerRate = .3f;
void Start () {
InvokeRepeating("DoFlicker", .1f, flickerRate);
}
void DoFlicker()
{
int state = Random.Range(0, 2);
if(state == 1)
transform.renderer.enabled = false;
else
transform.renderer.enabled = true;
}
}
The script is made by Farooq Azam.
Your answer
Follow this Question
Related Questions
Z-fighting problem. 1 Answer
How to make an ocean by modifying a mesh 3 Answers
Rendering part of a mesh on the camera 1 Answer
rend.mesh ? I can't replace mesh 1 Answer