/// <summary> /// This rotates the tower gun to face the current target /// </summary> /// <param name="delta">frame delta time</param> public virtual void TrackNextTarget(float delta) { if (CurrentTarget == null) { return; } var difference = Mathf.Rad2Deg(TowerGun.GetAngleTo(CurrentTarget.GlobalPosition)) + 90; TowerGun.GlobalRotationDegrees += difference * (TargetingSpeed * delta); }