- Home /
indestructible gameobject
Hello guys, can you say, how can i make indestructible gameobject for few seconds?
I use gameObject.active = false;, to disable my object when it blow up, and i need, that it was indestructible few seconds afterward i set gameObject.active = true;, and in this few second it must be translucent, or blinking
This totally depends on your code.
When the object appears 'destroyed', disable the renderer (and possibly the collider as well) Run a function that alternates between renderer.enabled = true/false with a time delay between each change, then when the object has finished being 'indestructible' set the renderer to true, enable the collider, and the object lives on =]
I believe the way you do what alucardj said, the timer part, is
for (i=0, i
function yourBlink(){ if (renderer.enabled) renderer.enabled=false; if (!renderer.enabled) renderer.enabled=true; }