Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Fire(){ // jika karakter dapat menembak if (isCanShoot) { //Membuat projectile baru GameObject bullet = Instantiate(Projectile, (Vector2)transform.position - projectileOffset * transform.localScale.x, Quaternion.identity); // mengatur kecepatan dari projectile Vector2 velocity = new Vector2(projectileVelocity.x * transform.localScale.x, projectileVelocity.y); bullet.GetComponent<Rigidbody2D>().velocity = velocity * -1; //Menyesuaikan scale dari projectile dengan scale karakter Vector3 scale = transform.localScale; bullet.transform.localScale = scale * -1; StartCoroutine(CanShoot()); anim.SetTrigger("shoot"); }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement