AddForce transform.right not working correctly in 2d

Why does the rigidbody2D addforce work when using transform.up perfectly but using transform.right doesn’t work correctly. It seems to just transform the players position.

    public Transform fireDirection;
	public float speed = 1f;
	Transform collisionLinePoint1;
	Transform collisionLinePoint2;
	public int health = 100;
	Animator alienAnime;
	Rigidbody2D rb;
	bool colliding; 
	GameObject player;
	public Player_Control playerControl;
	Rigidbody2D playerRb;

	void Awake()
		player = GameObject.FindWithTag ("Player");
		collisionLinePoint1 = transform.FindChild ("collision_S");
		collisionLinePoint2 = transform.FindChild ("collision_E");
		collisionLinePoint1.localPosition = new Vector3 (1.15f, 1.82f, 0f);
		collisionLinePoint2.localPosition = new Vector3 (1.15f, -1.94f, 0f);
	// Use this for initialization
	void Start () {

		playerRb = player.GetComponent<Rigidbody2D> ();
		alienAnime = GetComponent<Animator> ();
		rb = GetComponent<Rigidbody2D>();
		player.GetComponent<Rigidbody2D> (); 


	void Update () {

		Death ();

		if (Input.GetButtonDown ("Fire3")) {
			// Doesnt work correct???
			playerRb.AddForce (transform.right * 400);
			// This works fine
			playerRb.AddForce (transform.up * 400);


I think you mean to be using

playerRb.AddForce (Vector2.right * 400);

and also you could make 400 a public variable to edit it in the inspector on the fly.

One reason this could be an issue is because you’re condition is only met once on the frame the button is pressed. If you’re expecting the object to move immediately and gain the expected velocity, you can AddForce with ForceMode.Impulse.

//Only returns true for the frame it was pressed.
if (Input.GetButtonDown ("Fire3"))

playerRb.AddForce (Vector2.right * 400, ForceMode2D.Impulse);

Keep in mind that transform.right and Vector2.right are essentially the same thing (1, 0). So by multiplying that by 400 you’re getting (400, 0) every frame. Unless you’ve adjusted all other physics properties, this is gonna send your object flying with default values. Hope this helps.