// Start is called before the first frame update void Start() { spawn = GetComponentInParent <EnemySpawn>(); moveTime = spawn.GetMoveTime(); //fadeTime = 1; //Material mat = GetComponent<MeshRenderer>().material; //mat.DOFade(0, fadeTime).From(); float time = Random.Range(0, floatingTime); var sequence = DOTween.Sequence() .AppendInterval(time) .Append(transform.DOLocalMoveY((transform.localPosition.y + increasePositionY), floatingTime).SetEase(Ease.OutQuad)) .Append(transform.DOLocalMoveY((transform.localPosition.y), floatingTime * 2).SetEase(Ease.InOutQuad)); sequence.Play().SetLoops(-1); //Sequence move = DOTween.Sequence().Append(transform.DORotate(new Vector3(0, 0, randomRotationValue), 3, RotateMode.LocalAxisAdd)) // .Append(transform.DORotate(new Vector3(0, 0, -randomRotationValue), 3, RotateMode.LocalAxisAdd)) // .Append(transform.DORotate(new Vector3(0, 0, -randomRotationValue), 3, RotateMode.LocalAxisAdd)) // .Append(transform.DORotate(new Vector3(0, 0, randomRotationValue), 3, RotateMode.LocalAxisAdd)) // .AppendInterval(rotateStartTime); //move.Play().SetLoops(-1); //transform.DOLocalMoveY(transform.localPosition.y - 20.0f, moveTime).From().SetDelay(delayTime).SetEase(Ease.OutQuad); }