Make an object expand for a bomb

i want to make a script that has a game object which is a sphere and uses a coroutine that expands the sphere to make a bomb how should I do that

It sounds like you have already chosen how you are going to do it.

Which parts are you specifically having trouble with?

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220

This is the bare minimum of information to report:

  • what you want
  • what you tried
  • what you expected to happen
  • what actually happened, log output, variable values, and especially any errors you see
    - links to actual Unity3D documentation you used to cross-check your work (CRITICAL!!!)

The purpose of YOU providing links is to make our job easier, while simultaneously showing us that you actually put effort into the process. If you haven’t put effort into finding the documentation, why should we bother putting effort into replying?

Imphenzia: How Did I Learn To Make Games:

Two steps to tutorials and / or example code:

  1. do them perfectly, to the letter (zero typos, including punctuation and capitalization)
  2. stop and understand each step to understand what is going on.

If you go past anything that you don’t understand, then you’re just mimicking what you saw without actually learning, essentially wasting your own time. It’s only two steps. Don’t skip either step.

An expanding sphere won’t be apply enough force to other objects to make a convincing bomb. But if this is just for the visual effect of the bomb blast then you can do this:

using UnityEngine;

public class TheBomb : MonoBehaviour
{
    void Start()
    {
        Destroy(gameObject,1); // Destroy ourselves after 1 second
    }

    void Update()
    {
        transform.localScale+=Vector3.one*60*Time.deltaTime; // expand the gameobject that this script is attached to
    }
}

But to make a bomb that can forcefully push physics objects then you need something like this.