IEnumerator IETargetLock() { Vector3 pos = GetTarget().position; isEscaped = false; float speedMultiplier = 1.5f; float speed = SpeedRotate * speedMultiplier; while (true) { if (GetTarget()) { GameMath.RotateToPosition(body, pos, speed, startAngle, targetAngle); pos = GetTarget().position; } else { SetLastPosition(pos); if (GameMath.CheckAngleToTarget(pos, body)) { yield return(IEWaitPosition(3f, pos)); } } yield return(null); } }