Bullet fire: follows camera and overshoot after 1sec

Hello,
as the titles I have an extremely strange behavior with bullet fire system.

What happens is that the bullet is correctly instantiated and moves when fired.
But for some short time, if I move the camera it follows it.
Then it kind of overshoot in the target direction.

I implemented something very simple, actually a simplified version of this tutorial:

Well most implementation are the same.
I get the center point of the screen with fpsCamera.ViewportPointToRay(0.5f, 0.5f, 0)
Calculate the direction: hit point - spawnpoint
Then instantiate the bullet and addforce to it.

Below is my code.
If you have any idea what could cause this issue I would be grateful :slight_smile:

    public void fire()
    {

        RaycastHit hit;
        Vector3 targetPoint;

        if (animator != null)
            animator.SetTrigger("FireTrigger");

        // calculate travel direction of the projectile
        Ray ray = fpsCamera.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0));

        if (Physics.Raycast(ray, out hit))
        {
            targetPoint = hit.point;
        }
        else
        {
            targetPoint = ray.GetPoint(75f);
        }

        Vector3 directionWithoutSpread = targetPoint - spawnPoint.position;
        directionWithoutSpread.Normalize();

        GameObject currentBullet = Instantiate(bullet, spawnPoint);
        Rigidbody bulletRb = currentBullet.GetComponent<Rigidbody>();
        bulletRb.AddForce(directionWithoutSpread * ShootForce, ForceMode.Impulse);
    }

Ok found the reason:
Instantiate called like I do here above does not define the position but the parent.
In my case the parent is child of the weapon, itself a child of the camera.
GameObject currentBullet = Instantiate(bullet, spawnPoint);

And Instantiate like below, actually defines a position and no parent.
As I did not care about the rotation I thought to spare this parameter, but no, it calls another version of Instantiate with a somewhat different behavior:
GameObject currentBullet = Instantiate(bullet, spawnPoint.position, Quaternion.identity);