Time for action – the point of impact
We're finished tweaking the explosion, so you should delete the instance of the Explosion Prefab from the Scene view. The original stays safe and sound in the Prefab container in your Project panel. Naturally, we want this explosion to appear whenever we detect that the bomb has hit the ground. We've already put the logic in place to detect a ground hit—remember that we're moving the bomb back up into the sky as soon as it drops below ground level. So it should be a reasonable hop, skip, and jump towards making that explosion happen. And luckily, it is!
Open up your Bomb Script and add the following variable at the very top:
var prefab:GameObject;
Then, just after the code where we detect a ground hit, add this line:
if(transform.position.y < 0) { Instantiate(prefab, transform.position, Quaternion.identity);
We created a variable called prefab
at the top of the script to store some sort of GameObject. Note that small-p "prefab" is not a Unity keyword...