public void ResetPath(Vector2 position) { //not actually random, just named so int rand = manager.ClosestPoint(new Vector2(transform.position.x, transform.position.z)).transform.GetSiblingIndex(); path.Clear(); path = manager.CreatePath(manager.transform.GetChild(rand).GetComponent <PathPoint>(), position); }