Align rotation to a vector3 point

Hi, I’m trying to allign my “spawn projectile point” to where my mouse cursor is, but I’m having a bit of a problem. As you can see in the image, it has a slight offset.

166750-aim-offset.jpg

I’ve set my player right hand IK to 1 already and I’m setting it to aim towards that silver sphere (that is my cursor position)

    private void OnAnimatorIK()
    {
        // Weapon aim at target IK
        animator.SetIKPositionWeight(AvatarIKGoal.RightHand, 1f);
        animator.SetIKPosition(AvatarIKGoal.RightHand, aimTarget.position);
    }

The thing is that as you can see in the picture, the z-axis of my spawn point is a bit off.
I have the code in the player to fire the bullet and pass the bulletSpawnPoint (that is a transform I have parented to the player bones to indicate where I want the bullet to spawn from) as an Euler Angle:

private void Fire()
        {
            var go = Instantiate(bulletPrefab);
            go.transform.position = bulletSpawnPoint.position;
            var bullet = go.GetComponent<Bullet>();
            bullet.Fire(go.transform.position, bulletSpawnPoint.eulerAngles + aimTargetOffset, gameObject.layer);
        }

And lastly I have a script in the bullet that tells it to move forward based on the parameters I’ve set

    public void Fire(Vector3 position, Vector3 euler, int layer)
    {
        transform.position = position;
        transform.eulerAngles = euler;
        transform.position = new Vector3(transform.position.x, transform.position.y, 0f);
        transform.rotation = Quaternion.LookRotation(transform.forward, Vector3.forward);
    }

    void Update()
    {
        transform.Translate(Vector3.forward * velocity * Time.deltaTime);
    }  

Does anyone have any ideas?

Thank you

Not entirely sure about your rig setup here, but is it just that the right hand is pointing correctly, but that doesn’t translate to the gun tip as you expect?

166755-cxsmqy44ta.png

The IK is aiming correctly since the joint is aiming at the sphere.
The thing is though, that I would like the projectile that comes out ot the bulletSpawnPoint to be facing the sphere as well, because as you can see it will miss it by a little bit.