# [2D] Rotations become tighter the further left they are?

What I’m trying to do is instantiate multiple projectiles based on one rotation, and slightly adjust the rotations of the projectiles through iteration to create a ‘cone attack’ effect. However, it only works well when the target is to the right of the origin/attacking unit. The rotations of the projectiles become tighter and tighter the further left the target is, until they’re all overlapping when the target is directly left of the origin. Any help or insight would be greatly appreciated.

``````                for (var i = 0; i <= NumberOfPulses; i++)
{
var didCenter = false;
for (var n = 1; n <= BulletsPerPulse; n++)
{
if (n == 0) continue;
_playerPos = _playerTransform.position;
_myPos = _myTransform.position;

// rotation toward player -->
var diff = _playerPos - _myPos;
diff.Normalize();
var newRotation = Quaternion.Euler(0f, 0f, rotZ);
var newRot1 = newRotation;
var newRot2 = newRotation;
// <--

bullet1 = Instantiate(Projectile, _myPos, newRot1) as GameObject;
bullet2 = Instantiate(Projectile, _myPos, newRot2) as GameObject;
if (!didCenter)
{
bullet3 = Instantiate(Projectile, _myPos, newRotation) as GameObject;
if (bullet3)
{
bullet3.name = n + " " + newRotation + " " + " bul1 " + (BulletSpreadVariance*n);
didCenter = true;
}
}

if (!bullet1 || !bullet2) continue;

bullet1.name = n + " " + newRot1.z + " " + " bul1 " + (BulletSpreadVariance*n);
bullet2.name = n + " " + newRot2.z + " " + " bul2 " + (BulletSpreadVariance*n);

}
}
``````

StarManta on the forums was able to enlighten me that I am misusing quaternions, and he helped point me in the right direction. You can view the thread here: http://forum.unity3d.com/threads/243575-2D-Rotations-become-tighter-the-further-left-they-are?p=1611741&posted=1#post1611741

In short, the answer was to not adjust the .z value directly, but instead modify the rotation using the AngleAxis method of the quaternion helper class.

``````var newRot1 = newRotation * Quaternion.AngleAxis(newRotation.z + n * BulletSpreadVariance, Vector3.forward)
var newRot2 = newRotation * Quaternion.AngleAxis(newRotation.z - n * BulletSpreadVariance, Vector3.forward)
``````

``````var newRot1 = newRotation;
var newRot2 = newRotation;