void Start() { cars = new List <CarRaceController>(GameObject.Find("Cars").GetComponentsInChildren <CarRaceController>()); deathWallFollower = GameObject.Find("DeathWall").GetComponent <FollowPathV2>(); deathWallFollower.followFromBehind = true; deathWallFollower.desiredDistToFollower = deathWallDistance; finishLine = GameObject.Find("FinishLine"); triggers = GameObject.Find("LapTriggers").GetComponentsInChildren <LapTrigger>(); pathDecisor = gameObject.GetComponent <PathDecisor>(); carRespawner = GameObject.Find("CarRespawner").GetComponent <FollowPathV2>(); carRespawner.followFromBehind = true; carRespawner.desiredDistToFollower = carRespawnerDistance; bool lapCalculated = false; while (!lapCalculated) { lapCalculated = pathDecisor.CalculateLapPath(); } }
// Use this for initialization void Start() { body = transform.GetComponentInChildren<CarPhysicsController>(); nodeToFollow = transform.GetComponentInChildren<FollowPathV2>(); }
// Use this for initialization void Start() { body = transform.GetComponentInChildren <CarPhysicsController>(); nodeToFollow = transform.GetComponentInChildren <FollowPathV2>(); }