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

A leap of faith

The first piece of code (the first lines of our Script) looks like this:

function Update () {
}

Click to place your cursor after the first curly bracket, and press the Enter key to make some space between the top and bottom curly braces. Press the Tab key to indent, to make your code look pretty. Then, type a single line of code so that your Script looks like this:

function Update () {
renderer.enabled = false;
}

Save your Script by pressing Ctrl + S or Command + S on the keyboard, or by choosing File | Save from the menu. For the remainder of this book, we'll assume that you've saved any modifications that you've made to your Scripts before trying them out.

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