im creating a projectile instance and setting it’s rotation and movement to head toward the mouse but it keeps firing at a 90 degree angle clockwise. Tired toying around but no success, any ideas?
//Get mouse co-ordinates relative to screen
Vector3 mousePosition = Input.mousePosition;
mousePosition = mousePosition;
//Get mouse co-ordinates relative to world
mousePosition = Camera.main.ScreenToWorldPoint(mousePosition);
// If the player is facing right...
if(playerCtrl.facingRight)
{
// ... instantiate the rocket facing right and set it's velocity to the right.
Rigidbody2D bulletInstance = Instantiate(rocket, transform.position, Quaternion.LookRotation(transform.position - mousePosition , Vector3.forward)) as Rigidbody2D;
bulletInstance.AddForce(bulletInstance.transform.right * speed);
}