3D FPS Projectile

I’ve created a FPS scene.


That’s the parent hierarchy of the current setup I’m using. This is the current script:

public class FireArrow : MonoBehaviour 
	public Rigidbody projectile;
	public Transform shotPos;

	void Update () 
		if (Input.GetMouseButtonUp(0)) 
		Rigidbody shot = Instantiate (projectile, shotPos.position, shotPos.rotation) as Rigidbody;
		shot.AddForce (shotPos.forward * 100f);

It’s spawning an arrow but the arrow stops moving forward after about 1 second and falls to the ground. Can anyone help?

EDIT: I’ve updated the script and now the arrow is jumping out to the left rather than moving forward? The movement has gotten better however it’s still not right.

A rigidbody needs to be a component on the arrow. You can’t just instantiate a rigidbody by itself.
First change it to

public GameObject projectile;

opening up an Inspector slot, to which you drag your arrow prefab, which should already have a rigid body attached.

Then instantiate the GameObject, and say shot.rigidbody.AddForce

This will work the way you want it to.
Also, the bow transform should probably not be a child of the main camera.