Moving GUI

Good evening fellow Unity Users.

I have been pondering my GUI code for the past couple of hours and I was wondering what the best course of action is take when I want my GUI to slide of the screen and allow another piece onto it.

For example, you hit “Options” and the entire menu slides to the left, with the options coming back on from the right.
I’m not that great at coding but an explanation as to how this would work or even some helpful links would be swell!


you can create a guigroup. in this group you put your interface. then you can move the group Rect with a vector2.lerp or increasing its size when you click on a button:

if(GUI.button(…) && groupRect.width < 500)
groupRect.width +=20;

the size will stop increasing when it reach 500;