Shooting with a problem, please help

Everything was working fine, but then I probably did something and now sometimes when shooting the block don’t have force and don’t move forward, it spawns in front of me and falls.

The code:

var bulletPrefab:Transform;
    
    function Update () 
    {
    
     if(Input.GetButtonDown("Fire1"))
    
       {
         
         //Create bullet
         var bullet = Instantiate(bulletPrefab, GameObject.Find("spawnPoint").transform.position, transform.rotation);
      
      //Direction of bullet and add force
      bullet.rigidbody.AddForce(transform.forward * 4000);   
    
       }
    }

If you need a screenshot of something please tell me.

Thank you.

Your box collider is probably intefering with the player collider. Try Instantiating just a little bit infront of the player (you should also store a reference to the spawnPoint at the Start, then use that instead of finding it every bullet) :

var bulletPrefab : Transform;
var bulletSpawn : GameObject;

function Start () 
{
    bulletSpawn = GameObject.Find("spawnPoint");
}

function Update () 
{
    if(Input.GetButtonDown("Fire1"))
    {
        //set position
        var bulletSpawnPosition : Vector3 = bulletSpawn.transform.position + transform.forward;

        //Create bullet
        var bullet = Instantiate(bulletPrefab, bulletSpawnPosition, transform.rotation);

        //Direction of bullet and add force
        bullet.rigidbody.AddForce(transform.forward * 4000); 
    }
}

transform.forward is referencing the game object that this script is attached to. Try using bullet.transform.forward