void Update() { if (isFirstHit) { GetComponent <Rigidbody2D>().bodyType = RigidbodyType2D.Dynamic; ai.moveSpots = groundSpot; ai.speed *= 2; ai.SetIndex(0); ai.SetTime(waitTime); isFirstHit = false; //isDie = false; anim.SetBool("hit", true); Instantiate(leafsPrefab, transform.position, Quaternion.identity); } else if (anim.GetBool("hit") && GetComponent <Rigidbody2D>().velocity.y < 0.1f) { transform.localScale = new Vector3(1, 1, 1); anim.SetBool("hit", false); } ai.Move(true); anim.SetBool("run", ai.GetIsMove()); }