Can you help make my character throw a object?

Hi,

I am trying to make my character throw an object but it won’t work can somebody look at my code and see if i did something wrong? The gameObject that its being thrown is stinkBombPrefab

public class Eddy : MonoBehaviour
{
    private CharacterController controller;
    private Animator anim;
    private Vector3 moveDirection = Vector3.zero;

    public float gravity = 20.0f;
    public float jumpForce = 10.0f;
    public float speed = 50.0f;
    public float turnSpeed = 50.0f;
    public float throwForce = 10.0f;

    public GameObject runFacevar;
    public GameObject jumpFacevar;
    public GameObject idleFacevar;
    public GameObject Yoyovar;
    public GameObject stinkBombPrefab;

    private bool isAttacking = false;

    // Start is called before the first frame update
    void Start()
    {
        controller = GetComponent<CharacterController>();
        anim = gameObject.GetComponentInChildren<Animator>();

        runFacevar = GameObject.Find("/Eddy_idle 1/Armature.001/Root bone/Spine 1/Spine 2/Neck/GEOfacerun");
        jumpFacevar = GameObject.Find("/Eddy_idle 1/Armature.001/Root bone/Spine 1/Spine 2/Neck/GEOfacejump");
        idleFacevar = GameObject.Find("/Eddy_idle 1/Armature.001/Root bone/Spine 1/Spine 2/Neck/GEOfaceidle");
        Yoyovar = GameObject.Find("/Eddy_idle 1/Armature.001/Root bone/Spine 1/Spine 2/Left Arm 1/Left Arm 2/Left Hand/Eddy yoyo");
    }

    // Update is called once per frame
    void Update()
    {
        if (controller.isGrounded && Input.GetKey("up"))
        {
            anim.SetInteger("AnimPar", 1);
            moveDirection = transform.forward * Input.GetAxis("Vertical") * speed;
            float turn = Input.GetAxis("Horizontal");
            transform.Rotate(0, turn * turnSpeed * Time.deltaTime, 0);

            runFacevar.SetActive(true);
            idleFacevar.SetActive(false);
            jumpFacevar.SetActive(false);

        }
        else if (controller.isGrounded)
        {
            anim.SetInteger("AnimPar", 0);
            moveDirection = transform.forward * Input.GetAxis("Vertical") * 0;
            float turn = Input.GetAxis("Horizontal");
            transform.Rotate(0, turn * turnSpeed * Time.deltaTime, 0);

            runFacevar.SetActive(false);
            idleFacevar.SetActive(true);
            jumpFacevar.SetActive(false);

        }

        if (Input.GetButtonDown("Jump") && controller.isGrounded)
        {
            anim.SetInteger("AnimPar", 2);
            moveDirection.y = jumpForce;

            runFacevar.SetActive(false);
            idleFacevar.SetActive(false);
            jumpFacevar.SetActive(true);

        }

        if (Input.GetKeyDown(KeyCode.X))
        {
            StartCoroutine("Attack");
        }

        if (Input.GetKeyDown("ThrowBomb") && controller.isGrounded)
        {
            anim.SetInteger("Throwing", 3); // Set an animation state for throwing the bomb

            // Instantiate the stink bomb at the character's hand (or any desired position)
            GameObject stinkBomb = Instantiate(stinkBombPrefab, Yoyovar.transform.position, Yoyovar.transform.rotation);

            // Add force to the stink bomb to simulate the throw
            Rigidbody bombRigidbody = stinkBomb.GetComponent<Rigidbody>();
            if (bombRigidbody != null)
            {
                bombRigidbody.AddForce(transform.forward * throwForce, ForceMode.Impulse);
            }
        }

        controller.Move(moveDirection * Time.deltaTime);
        moveDirection.y -= gravity * Time.deltaTime;

        
    }
    private IEnumerator Attack()
    {
        Yoyovar.SetActive(true);
        anim.SetTrigger("Attack");
        yield return new WaitForSeconds(.7f);
        Yoyovar.SetActive(false);
    }
}