player detection Script

I am to trying get this Script to start shooting when the Player’s Velocity is above 0. I have tested it but when the player is stationary it’s still shooting projectiles.

public Rigidbody Bullet;

public Rigidbody PlayerRigidbody;

// Use this for initialization
void Start () {
	PlayerRigidbody = GameObject.Find("Player").GetComponent<Rigidbody>();
}

// Update is called once per frame
void Update () 
{
	if(PlayerRigidbody.velocity.magnitude < 0)
	{
		
		 Instantiate(Bullet,transform.position,transform.rotation);
		 transform.TransformDirection(Vector3.down * 10);
		
	}
	{

	}

}
}

Check that only the player has the tag “Player”. If so and it still shoots when your stopped, then that means that the magnitude never really goes to 0, so i would play around and decide on a slight offset from 0, so that it doesen’t fire when magnitude is really small.