// Use this for initialization void Start() { points = FindObjectOfType <PointCollectionScript>(); agent = GetComponent <NavMeshAgent>(); error = points.error; end = FindObjectOfType <EndPointScript>(); player = FindObjectOfType <PlayerScript>(); }
// Update is called once per frame void Update() { if (!mHUD) { mHUD = transform.FindChild("HUDCanvas").gameObject.GetComponent <HUDScript>(); } if (!playerController) { playerController = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerControllerIk>(); } if (!startPointScript) { startPointScript = GameObject.FindGameObjectWithTag("Start").GetComponent <StartPointScript>(); } if (!endPointScript) { endPointScript = GameObject.FindGameObjectWithTag("End").GetComponent <EndPointScript>(); } }