public void VectorComponents(Vector3 point, Transform origin, int index) { //ideally, you would feed the visualizer with info like the point and origin. but thats a lot of work so im just going off indexes<3 relPos = GetRelativePosition(origin, point); //position of the point with the non-zero origin as new reference pt relMag = relPos.magnitude; //magnitude of the point with the canvasScript.setVariables(relPos, relMag, origin); if (index == 0) { for (int i = 0; i <= 3; i++) { VisualizeComponent(point, i, origin); } } if (index == 1) { for (int i = 0; i <= 3; i++) { VisualizeAxes(point, i, origin); } } if (index == 2) { for (int i = 0; i <= 3; i++) { VisualizeUnitVectorComponent(point, i, origin); } } }