How to manipulate a transform.rotation?

I’m trying to access, and continually update a transform rotation. However I can set the transform, but it doesn’t update. it’s just +20 to the y axis, from the game start.

function Update() 
{   
  	 transform.Rotate(Vector3.up * speed * Time.deltaTime);
     var ninetydegrees = Quaternion.Euler(transform.rotation.x, transform.rotation.y+20, transform.rotation.z);
     
        if(Time.time >= nextFire)
        {
            nextFire = Time.time + fireRate;
            var bullet = Instantiate(enemyBullet, transform.position, transform.rotation);
            var bullet2 = Instantiate(enemyBullet, transform.position, ninetydegrees);
            }
}

I’m confused!

Thanks, Bobblehead.

You wouldn’t manipulation transform.rotation unless you understand quaternions. transform.rotation.y+20 isn’t +20 degrees on the y axis, since rotation.y doesn’t directly correspond to the y axis, and the units involved are not degrees. Instead use

var ninetydegrees =  transform.rotation * Quaternion.Euler(transform.up * 20);

Although the variable is misnamed; I would suggest something like “var newRotation” instead.