Throwing a sword

Hey guys, I’m making a 2D RPG for a school class. One of the things I need to do it’s that my player can throw an object (a sword in my “game”), so, I have this two scripts (first the player movement script, second the sword prefab script); When the player is facing right the sword goes right, when is facing left, the sword goes left, how can I make it? Thank you so much.

public class playermovement : MonoBehaviour {
	
	int contador;
	public Text Puntuacion;

	Rigidbody2D rbody;
	Animator anim;




	// Use this for initialization
	void Start () {
		

		rbody = GetComponent<Rigidbody2D> ();
		anim = GetComponent<Animator> ();
		contador = 0;
		Puntuacion.text = "o: " + contador;

	}
	
	// Update is called once per frame
	void Update () {
	
		Vector2 movement_vector = new Vector2 (Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));

		if (movement_vector != Vector2.zero) {
			anim.SetBool ("iswalking", true);
			anim.SetFloat ("input_x", movement_vector.x);
			anim.SetFloat ("input_y", movement_vector.y);
		} else {
			anim.SetBool ("iswalking", false);
		}

		rbody.MovePosition (rbody.position + movement_vector * Time.deltaTime);



	}

	void OnTriggerEnter2D(Collider2D other) {
		if (other.gameObject.tag == "moneda") {
			DestroyObject (other.gameObject);
			contador = contador + 1;
			Puntuacion.text = "o: " + contador;
		}
	}



	}


public class sword : MonoBehaviour 
{

	[SerializeField]
	private float speed;

	private Rigidbody2D myRigidbody;

	private Vector2 direction;

	// Use this for initialization
	void Start () {

		myRigidbody = GetComponent<Rigidbody2D> ();
		direction = Vector2.right;
	
	}

	void FixedUpdate()
	{
		myRigidbody.velocity = direction * speed;

	}
	


	void OnBecameInvisible()
	{
		Destroy (gameObject);
	}
}

Check for input on the button you want to control the sword throwing.

Instantiate the sword prefab with the same rotation as the character

Use Rigidbody2D.AddForce to move the sword object and set the force mode to do what you want- don’t set the velocity directly. If you want to skip the physics engine, manipulate transform.position instead of the Rigidbody.

have the sword script check for a collision with enemies, destructables, ect using OnTriggerEnter. Unless you are doing physics things after the sword collision, set the sword collider to be a trigger.

Ok, I’m throwing swords adding this to my player script:

public Transform firePoint;
	public GameObject sword;

void Update () {

		if (Input.GetKey (KeyCode.F))
		{
			Instantiate (sword, firePoint.position, firePoint.rotation);

		}

I create an empty object attached to my player (firePoint) and added the prefab sword. When I’m facing right I can shoot a sword to the right buy when I’m facing left the sword also goes to the right from the back of my player. Other question, if I hold down the “F” key (throwing key) never stop throwing swords, I want a “press and release” mechanism, in other words, one push one sword. Any ideas? Thank you.