O'Reilly logo

Getting Started with Unity 5 by Dr. Edward Lavieri

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Scripting with C# in Unity

Let's get our feet wet by jumping right in and start scripting. The following are the steps to create a new script in Unity using C#:

  1. Launch Unity.
  2. Open the game project.
  3. From the top menu, navigate and select Assets | Create | C# Script.
  4. You'll see the script in the Project view and you'll be in script name edit mode. Name the script testScript. We'll delete this script when we are finished:
    Scripting with C# in Unity

    The script is now visible in the Inspector view.

  5. In the Project view, under Assets, double-click on the script. This will launch MonoDevelop and provide you with the ability to edit the script:
  6. Add the following line of code in MonoDevelop ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required