Time for action – let's get lazy

There's no need to create an entirely separate script for the stein. Follow these steps to get more bang for your buck out of a single script:

  1. Find the script you called Bomb Script in the Project panel, and rename it FallingObject. Because we'll be using the script more generically, we should give it a more generic name.

    Note

    Renaming a Script in the Editor is fine for UnityScript, but you'll cause problems if you rename a C# Script in this way, without also changing the Class declaration at the top of the Script in MonoDevelop.

  2. In the Project panel, select the Stein Prefab (not the Stein Model).
  3. Choose Component | Scripts | FallingObject in the menu to attach the script to the Prefab.
  4. In the Inspector panel, you should ...

Get Unity 4.x Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.