W key is unresponsive with input

For some reason the W key only works every once in awhile on every computer but the one I built the project on which it works fine for.

void FixedUpdate ()
{
		if (Input.GetKeyDown ("w"))
			rigidbody2D.AddForce (Vector2.up * jumpHeight);
}

Yes I know this means the gameobject can jump infinitely but it works fine for this game

There is nothing wrong with the code itself, so it must be the position of the code in the document that is the problem.

I applied the following script to a 2D sprite object and it works fine!

public class TestScript : MonoBehaviour {

	
	public int jumpheight = 25; 
	
	
	void Start()
	{

	}
	
	void Update()
	{

		if (Input.GetKeyDown ("w"))
			rigidbody2D.AddForce (Vector2.up * jumpheight);
		
	}
}

But remember: The GetDown method returns true during the frame the user starts pressing down the key. So it will only work for one click, or if you press multiple times it will look like a flappy bird game. If you want to get the object to keep moving while holding the button you can for instance use

void Update()
	{

		if (Input.GetKey ("w"))
			rigidbody2D.AddForce (Vector2.up * jumpheight);
		
	}