- Home /
Question by
Cookied8 · May 28, 2012 at 09:48 AM ·
animationflickering
Flickering Animation
I'm trying to create a game, but I want an object (e.g. a cube) so it looks like its flickering on and off. Then, when you get close enough, a collider makes it disappear. Is there any scripts that make this possible. Thanks.
Comment
Answer by Baconaise · May 28, 2012 at 03:29 PM
Could you do something like this?
bool flickerOn = true;
void Update()
{
flickerOn = !flickerOn;
gameObject.renderer.enabled = flickerOn;
}
This would flicker pretty fast so you may put a frame count around it.