private void UpdateMovement() { Vector3 targetPosition = WayPointManager.Instance.Paths[pathIndex].WayPoints[wayPointIndex].position; transform.position = Vector3.MoveTowards (transform.position, targetPosition, moveSpeed * Time.deltaTime); transform.localRotation = AutoScaler.SmoothlyLook(transform, targetPosition); transform.localRotation = AutoScaler. SmoothlyLook(transform, targetPosition); if (Vector3.Distance(transform.position, targetPosition) < .1f) { wayPointIndex++; } }
private void SmoothlyLookAtTarget(Vector3 target) { towerPieceToAim.localRotation = AutoScaler. SmoothlyLook(towerPieceToAim, target); }