public void changeTarget(Transform newTarget) { AIPath ai = GetComponent <AIPath>(); ai.updateTarget(newTarget); }