void Launch() { GameObject bulletObject = Instantiate(bulletPrefab, rigidbody.position, Quaternion.identity); GonzalezBullet bulletCopy = bulletObject.GetComponent <GonzalezBullet>(); bulletCopy.Launch(lookDir, 300f); animator.SetTrigger("Launch"); }
void shoot(Vector2 shooter, Vector2 target) { Vector2 direction = target - shooter; GameObject bulletObject = Instantiate(bulletPrefab, shooter, Quaternion.identity); GonzalezBullet bulletCopy = bulletObject.GetComponent <GonzalezBullet>(); bulletCopy.Launch(direction, 300f); //animator.SetTrigger("Launch"); }