Instantiating with Quaternions

I don’t understand Quaternions, but this line spawns a bullet with the correct rotations except y, which is set to zero, even though spawn doesn’t have a rotation.y of zero.

var currentBullet : GameObject = Instantiate(bullet, spawn.transform.position, Quaternion.Euler(0, spawn.transform.rotation.y, 90));

Help appreciated, I’m sure its something obvious!

If you initialize quaternion using euler angles, then don’t use rotation.y. Use eulerAngles.y instead:

Quaternion.Euler(0, spawn.transform.eulerAngles.y, 90)