rotate 90% in local space

ok so i have a cube and it responds to the directional keys. whichever key is pressed it needs to add 90 degrees to its rotation in that direction.

(i can do it just fine with Transform.rotate except if the cube is facing down and i rotate to the left instead it rotates the object along what is now the objects z axis)

how do i rotate the object in increments of 90 degrees relative to the objects up down left right ( v.s global directions)?

answer : Transform.TransformDirection converts local to world space keeping relative left right up down

it is not way to rotate the object in the same place. but u can mark down the number on the inspector window. i mean the x,y,z number. then change to play with the number would be one of the easy way to do that.

Transform.Rotate has another parameter that specifies the Space in which it should rotate the object. The default is Space.Self which is already local space. Maybe you want to rotate it in world space?

i meant degrees not quite sure why i put %