How can i rotate a box to new position?

I have a box like in the picture, and i want to rotate it to a new position next to it. I use transform.rotation(0,0,90) but the box only rotate it self. Can someone help to rotate it to the position next.
Here is a picture to see better…


Thanks

You want to use Transform.Rotate(0,0,90)

Rotation takes a special variable type to apply the rotations, whereas Rotate takes a vector and applies it. Here’s the documentation for it.

Hello
Thanks by the answer but using transform.rotate the object still doesn’t leave the place. Only rotate over it self. What i want is the object rotate to the place next. Like in real world rotate a heavy stone to move it.
Like in this picture, lines should be the new target after rotate: