Shooting arrow in the right rotation

Hello I’m trying to make the arrow shoot in the right rotation, according to where the player is facing…
can’t figure how to do it

the camera is child of the bow, and you can only rotate up and down

that’s the script attached to the bow, the arrow is shot with the same angle no matter where I look

{

public GameObject arrow;
public Transform arrowSpawn;
public Camera cam;
public float shootForce;

// Start is called before the first frame update
void Start()
{
    shootForce = 20;

}

// Update is called once per frame
void Update()
{

    if (Input.GetKey(KeyCode.UpArrow))
    {
        transform.Rotate(0, 0, 1);
    }

    else if (Input.GetKey(KeyCode.DownArrow))
    {
        transform.Rotate(0, 0, -1);
    }

    else if (Input.GetKeyDown(KeyCode.Space))
    {
        GameObject shot = Instantiate(arrow, arrowSpawn.position, arrow.transform.rotation);
        Rigidbody rb = shot.GetComponent<Rigidbody>();
        rb.velocity = cam.transform.forward * shootForce;
    }
}

}

Set object “shot” rotation same as camera.

Apply velocity

rb.velocity = shot.transform.forward * shootForce;

any help?

Try this

else if (Input.GetKeyDown(KeyCode.Space))
     {
         GameObject shot = Instantiate(arrow, arrowSpawn.position, Quaternion.identity);
         Rigidbody rb = shot.GetComponent<Rigidbody>();
         rb.velocity = cam.transform.forward * shootForce;
     }