下記コードの代入文でエラーが出てしまうのですが
scriptからrotationに代入するにはどうすれば良いのでしょうか?

float[] B_rad = {-20.0f,0f,20.0f};

void Start(){
for(int i=0; i < 3; i++){
transform.rotation.z = B_rad[i] * Mathf.Deg2Rad;
}
}