// Update is called once per frame void Update() { transform.position = Vector3.MoveTowards(transform.position, target, speed * Time.deltaTime); tempTarget = FindObjectOfType <lineDrop>().transform.position; if (tempTarget != null) { target = new Vector3(tempTarget.x, tempTarget.y, tempTarget.y); } lineScript.MakeLine(); if (CurrentTime <= startTime) { CurrentTime += Time.deltaTime; } else if (CurrentTime >= startTime) { Boss2Aim.shoot(); target = target = new Vector3(tempTarget.x, tempTarget.y, tempTarget.y); /* while (transform.position.x != target.x) * { * // transform.position = Vector3.MoveTowards(transform.position, target, speed * Time.deltaTime); * if(transform.position.x == target.x) * { * break; * } * }*/ CurrentTime = 0; } if (eHealthMan.currentHealth <= 0) { //display somthing player.setCanDash(true); Destroy(gameObject); } }