O'Reilly logo

Unity 3D Game Development by Example by Ryan Henson Creighton

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

Time for action - write your first Unity Script

Let's open our keep-up game project from the previous chapter, if it's not open already. We'll write a really simple Script and stick it to our Ball Game Object.

In the Project panel, right-click on an empty chunk of space and choose Create | JavaScript. Alternatively, you can click on Assets | Create | JavaScript in the menu at the top of the screen, or use the Create button at the top of the Project panel. It's not a bad idea to use the same menu to create a folder that will hold all your Scripts. A new Script is added to the Project panel with the default name NewBehaviourScript.

  1. Rename the Script. Click to select it, and press F2 on your keyboard on the PC, or click on it once more to rename ...

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