MonoBehaviour.Start Manual     Reference     Scripting  
Scripting > Runtime Classes > MonoBehaviour
MonoBehaviour.Start

function Start () : void

Description

Start is called just before any of the Update methods is called the first time.

Start is only called once in the lifetime of the behaviour. The difference between Awake and Start is that Start is only called if the script instance is enabled. This allows you to delay any initialization code, until it is really needed. Awake is always called before any Start functions. This allows you to order initialization of scripts.

The Start function is called after all Awake functions on all script instances have been called.

JavaScript
// Initializes the target variable.
// target is private and thus not editable in the inspector

private var target : GameObject;

function Start () {
target = GameObject.FindWithTag ("Player");
}

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
private GameObject target;
void Start() {
target = GameObject.FindWithTag("Player");
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

private target as GameObject

def Start():
target = GameObject.FindWithTag('Player')