So I have the bullet shooting to the mouse position all fine, just working on getting the bullet sprite to rotate to make it look like it is shooting straight to it.
My Code:
void StaffBulletAttack(){
if (lookLeft) {
Vector3 sp = Camera.main.WorldToScreenPoint(transform.position);
Vector3 dir = (Input.mousePosition - sp).normalized;
Rigidbody2D bPrefab = Instantiate (staffBulletPrefab, transform.position, Quaternion.identity) as Rigidbody2D;
bPrefab.rigidbody2D.AddForce (dir * 650);
coolDown = Time.time + attackRate;
}
}
Any help is greatly appreciated, thanks