Creating our first script

Scripts can be created in several ways in Unity3D, including from the main menu (Assets | Create | JavaScript/C# Script/Boo Script) or from the Project window (Create | JavaScript/C# Script/Boo Script).

Once the script is created, it needs to be linked to an object.

Creating our first script

From the scene we have created in the previous chapter, we will create a new script that displays a message in the console. Using scripts usually involves creating the script, and attaching the script to an object. The script is called (or executed) when the object is created in the scene; however, we won't be able to play the scene until all scripts included ...

Get Getting Started with Unity now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.