Raycast direction problem

Hello,

I’m facing weird problem at direction o Raying with objects. When I ray a bullet, it goes right direction. When I add 2 bullets with 45 degrees from far position, my first bullet going up. I can’t fix this problem. Thank for your help already.
*
WHEN ONE BULLET SHOOTED
*
160134-screenshot-6.jpg
*
WHEN 3 BULLETS SHOOTED
*

Here is my code:
if(fireTime > 0)
{

       fireTime -= Time.deltaTime;

       }
       if(fireTime <= 0)
       {

            Shoot(); //first bullet
            specialPowers.SpreadedShoot(spreadPosition1); //second bullet
            specialPowers.SpreadedShoot(spreadPosition2); // third bullet

            fireTime = maxFireTime;


       }

        



    }

    void Shoot()
    {

        Ray ray = new Ray(firePosition.position, Vector3.forward);

        GameObject bulletGameObject = Instantiate(bullet, firePosition.position, Quaternion.identity);
        bulletGameObject.GetComponent<Bullet>().Initialize(ray.direction, bulletSpeed);

    }

public void SpreadedShoot(Transform spreadPosition)
    {
        Vector3 _dir = new Vector3(0, 1, 1);

        Ray ray = new Ray(spreadPosition.position, _dir);

        GameObject bulletGameObject = Instantiate(spreadBullet, spreadPosition.position, Quaternion.identity);
        bulletGameObject.GetComponent<Bullet>().Initialize(ray.direction, bulletSpeed);

    }

My guess would be that they are colliding with each other? Maybe put them all on the same layer called “Bullets” and then make sure that things on that layer dont collider with each other.

edit > project settings > Physics:

160147-collision.png

I was planning to build a new Raycast that goes through my relevant planes and performs a standard raycast and wanted to make sure I wasn’t wasting my time.

I’ve edited it and Ray should look like this
Ray ray = cam.ViewPortPointToRay(new Vector3(0.5F, 0.5F, 0));
cam is just a new variable write this:
public Camera cam;
then click the script and it has an empty variable and put your camera in there so the ray is in the middle of the camera where your facing.