moveToTargetAnimated method

void moveToTargetAnimated({
  1. required PositionComponent target,
  2. EffectController? effectController,
  3. double? zoom,
  4. double? angle,
  5. dynamic onComplete()?,
  6. bool followTarget = true,
})

Implementation

void moveToTargetAnimated({
  required PositionComponent target,
  EffectController? effectController,
  double? zoom,
  double? angle,
  Function()? onComplete,
  bool followTarget = true,
}) {
  moveToPositionAnimated(
    position: target.position,
    effectController: effectController,
    zoom: zoom,
    angle: angle,
    onComplete: () {
      if (followTarget) {
        follow(target);
      }
      onComplete?.call();
    },
  );
}