// Start is called before the first frame update void Start() { var points = gameObject.GetComponentsInChildren <MovingPlatformDestination>(); pointA = points[0]; pointB = points[1]; platformRB.transform.position = pointA.transform.position; currentDestination = pointB; }
public void SwitchDirections() { if (currentDestination == pointA) { currentDestination = pointB; } else { currentDestination = pointA; } }