
OnEnable: (only called if the Object is active): This function is called just after the object is enabled.(If a GameObject is inactive during start up Awake is not called until it is made active.) More info See in Glossary is instantiated. The prefab acts as a template from which you can create new object instances in the scene. Awake: This function is always called before any Start functions and also just after a prefab An asset type that allows you to store a GameObject complete with components and properties.More info See in Glossary starts (once for each object in the scene). In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. Think of each unique Scene file as a unique level. These functions get called when a scene A Scene contains the environments and menus of your game. If the image above does not display properly (for example, if you cannot see any text), please try another browser, such as Google Chrome or Mozilla Firefox.

Note: Some browsers do not support SVG image files.

The diagram below summarizes how Unity orders and repeats event functions over a script’s lifetime.įor more information about the various event functions, see the following sections:

This page describes those event functions and explains how they fit into the execution sequence. Running a Unity script executes a number of event functions in a predetermined order.
