protected override void Attack() { base.Attack(); AttackSphere pojectale = Instantiate(bullet, Direction.position, transform.rotation); pojectale.GetComponent <Rigidbody2D>().AddForce((Direction.position - transform.position).normalized * bulletSpeed); }
public void LaunchBullet(Vector3 target) { AttackSphere pojectale = Instantiate(bullet, transform.position, Quaternion.identity); Debug.Log("start pos " + pojectale.transform.position); Debug.Log("end pos " + target); pojectale.GetComponent <Rigidbody2D>().AddForce(target.normalized * bulletSpeed); }