Volcano Action

Heaya.Since this is a scripting thing Im looking at, I’ll post it here. I want to Instantiate a bunch of rigidbody meshes(virtual rocks) that will fall “down”. They represent rocks falling during a volcano eruption.

I dont really know anything about scripting so maybe by posting here I’ll at least get warmer to it, if not achieving my goal

The rocks need to instantiate 5minutes into the scene, so this is what I know so far. I need to instantiate(see script),and theres a time factor(see script also)the cloned rigid body is called"myRock"

var myRock : Transform;
\\that one was to reference my rigidbody\\
transform.instantiate(0, 7500 * Time.deltaTime, 0);
} 
OnAwake ()
{
Instantiate (gameObject);
\\those bits to make it happen but delay it 7500frames(5minutes into scene)
var theClonedRigidbody : Transform;
theClonedRigidbody = Instantiate(myRock,
transform.position, transform.rotation);
} 
OnCollisionEnter ()
{
Instantiate (gameObject);
transform:Scale(0.2,0.2,0.2)
\\Trying to replace collided meshes with smaller rocks\\
var theClonedRigidbody : Transform;
theClonedRigidbody = Instantiate(myRock,
transform.position, transform.rotation);
}

I’ll bet anybody five bucks it doesnt do what I’d like it to do :stuck_out_tongue: but if any of you pros can be bothered telling me where to start that would be cool…

No one has any tips?
AC

Without testing the script:

You want to have two seperate scripts here.

This one you just put on an empty game object somewhere, where you want to spawn the big rock. And assign myRock (myRock should be a prefab)

var myRock : Transform; 
function Start () 
{ 
	yield WaitForSeconds(5 * 60);
	Instantiate (myRock, transform.position, transform.rotation); 
}

This one you attach to the big rock.
Small rock should link to a prefab which contains several smaller rockets.

So just make a couple of smaller rocks, place them nicely. Group them into one empty game object and put them into a prefab.

Then you assign this prefab to the myRock variable in the script you attached to the big rock.

var smallRock : Transform; 
function OnCollisionEnter () 
{ 
	Destroy (gameObject);
	Instantiate (smallRock, transform.position, transform.rotation); 
}

Awesome Joachim I cant wait to try it-Thank you!