Start is called on the frame when a script is enabled just before any of the Update methods is called the first time.
// 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 public class Example(MonoBehaviour): private target as GameObject def Start() as void: target = GameObject.FindWithTag('Player')