How do I get and manipulate Transform values without changing the original Transform?

I want to add spread and inacurracy to my top-down shooter. The bullets spread as they should, but my gun kinda wiggles because it thinks I’m changing its Transform. My code so far looks like this:

protected void InstantiateBullet(float spread)
{
    Transform clickTransform = transformAtClick;

    float deviation = Random.Range(-inaccuracy, inaccuracy);
    float actualAngle = clickTransform.eulerAngles.z;
    Vector3 euler = Vector3.forward * (actualAngle + spread + deviation);

    clickTransform.rotation = Quaternion.Euler(euler);

    GameObject bullet = Instantiate(bulletPrefab, firePoint.position, clickTransform.rotation);

    Rigidbody2D rb = bullet.GetComponent<Rigidbody2D>();
    rb.AddForce(clickTransform.right * bulletSpeed * Time.fixedDeltaTime, ForceMode2D.Impulse);
}

What I think is the problem is that all Transforms store a reference to gameObject.transform, but I’m not sure. Honestly, I don’t know how to provide any further information, so I hope this is enough.

A Transform is a class, which in C# means that it is a reference type. As such, setting a Transform equal to another Transform doesn’t make a new copy, it just points to the same Transform (which is why adjusting a value on either will change the original). In this case, you don’t even need a Transform at all and can just use vectors and quaternions to get your desired rotation;

 protected void InstantiateBullet(float spread)
 {
     float deviation = Random.Range(-inaccuracy, inaccuracy);
     Quaternion clickRotation = Quaternion.AngleAxis (transformAtClick.eulerAngles.z + spread + deviation, Vector3.forward);
     GameObject bullet = Instantiate(bulletPrefab, firePoint.position, clickRotation);
     Rigidbody2D rb = bullet.GetComponent<Rigidbody2D>();
     rb.AddForce((clickRotation * Vector3.right) * bulletSpeed * Time.fixedDeltaTime, ForceMode2D.Impulse);
 }

I think if you add the euler rotation to the firePoint.position instead of the clickTransform.position it should work @theProdWorm