Now,i have a empty gameobject(HUB) attach with timer script. and a gameobject(Sphere) attach with Explosion when collision. So what i want is to combine them as in if(timer>100),see to add a rigidbody to the sphere or some how make the sphere fall function and to trigger my sphere OnCollisionEnter to explode. Any1 knows how to do it please help me thx alot. my 2 script below:
for now i cant add a rigibody to the sphere, as it will fall immediately.what i can think of is : if(timer>100) add a rigidbody to it. or add a rigidbody first as there got a Gravity check Box. by uncheck first. if(timer>100) then check the gravity box. So i doesnt know how to write it in script, any1 have idea.
HUB:
var timer : float = 0;
var FuelGauge : Texture;
function OnGUI () {
if(timer > 100)
{
//i wanted a function to call the sphere fall
GUI.Label( Rect( 5, 70, 100, 100 ), FuelGauge[10] );
Debug.Log("100 sec passed - No Fuel");
}
}
function Update () {
timer = Time.time * 1;
}
Explosion Script
var explosion : Transform;
function OnCollisionEnter(){
Destroy(GameObject.Find("sphere"));
var explosion1 : Transform;
explosion1 = Instantiate(explosion,transform.position,transform.rotation);
}