O'Reilly logo

Learn Unity 3D Programming with UnityScript: Unity's JavaScript for Beginners by Janine Suvak

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

Chapter     4

Using Scripts and the GameObject

Now that you have programming basics under your belt and a good grasp on the Unity editor and accompanying developer tools, it’s time to introduce scripting to the game scene.

Scripts work hand-in-hand with the Unity game engine. Your scripts customize game object behaviors using the classes, functions, and variables of the Unity API. You’ve already seen when you create a new project, Unity creates a very basic, functional game that consists of one empty scene. Similarly, when you create a new script, Unity populates it with an empty Start() and Update() function.

The Unity game engine does a lot of work behind the scenes. It runs the Start() and Update() functions on every game object whether you ...

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