// Use IEnumerator for initialization IEnumerator Start() { currentNodeIndex = 0; cam = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>(); simulator = GameObject.FindGameObjectWithTag("RVO_sim").GetComponent <RVO_Simulator>(); characterController = GetComponent <CharacterController>(); yield return(StartCoroutine(StartPaths())); agentIndex = simulator.addAgentToSimulator(transform.position, gameObject, pathNodes); }
// Use this for initialization IEnumerator Start() { currentNodeIndex = 0; simulator = GameObject.FindGameObjectWithTag("RVO_sim").GetComponent <RVO_Simulator>(); characterController = GetComponent <CharacterController>(); pathNodes = new List <Vector3>(); yield return(StartCoroutine(StartPaths())); agentIndex = simulator.addAgentToSimulator(transform.position, gameObject, pathNodes); //isAbleToStart = true; }