void OnMouseDown() { if (currentActiveDiverCount < maximumActiveDiverCount) { currentActiveDiverCount++; //IncreaseFarthestCheckpoint(); GameObject diver = Instantiate(diverPrefab, transform.position, Quaternion.identity); Diver diverComp = diver.GetComponent <Diver>(); diverComp.checkpoints = new List <GameObject>(checkpointObjects); diverComp.Initialize(movementSpeed, carryCapacity, farthestCheckpoint, scroungingTimerLength, this); } }