I have a script to shoot a bullet by using rigidBody2D.addForce. The issue is that if transform.right has a negative x component, there is no force being added. Basically I can shoot right but not left. Here is my code:
if (rotateWeapon.getMouseRelative().x > 0)
{
newBullet.transform.rotation = Quaternion.Euler(0, 180, -rotateWeapon.getRotationF()-180);
}
else if (rotateWeapon.getMouseRelative().x < 0)
{
newBullet.transform.rotation = Quaternion.Euler(0, 0, rotateWeapon.getRotationF());
}
newBullet.transform.position = transform.position;
newBullet.GetComponent<Rigidbody2D>().AddForce(newBullet.transform.right * bulletSpeed);