# Changing skybox using GUI button

**URL:** <https://discussions.unity.com/t/changing-skybox-using-gui-button/75504>\
**Category:** Questions & Answers\
**Created:** [July 10, 2013, 3:23pm UTC](https://discussions.unity.com/t/changing-skybox-using-gui-button/75504 "2013-07-10T15:23:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidflynn2](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@davidflynn2](https://discussions.unity.com/u/davidflynn2)\
**Post date:** [July 10, 2013, 3:23pm UTC](https://discussions.unity.com/t/changing-skybox-using-gui-button/75504/1 "2013-07-10T15:23:08Z")

</div>

I would like to make it so that my game has three different skybox options and when you click a GUI button it changes the skybox to the skybox material you chose. Is this possible?

---

<div class="post-metadata">

**Author:** ![create3dgames](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/create3dgames/32/576489_2.png) [@create3dgames](https://discussions.unity.com/u/create3dgames)\
**Post date:** [July 10, 2013, 8:48pm UTC](https://discussions.unity.com/t/changing-skybox-using-gui-button/75504/2 "2013-07-10T20:48:58Z")

</div>

var sky1 : Material;  
var sky2 : Material;  
var sky3 : Material;

```
function OnGUI () {

if(GUILayout.Button ("Sky 1"))
{
   RenderSettings.skybox = sky1;
}

if(GUILayout.Button ("Sky 2"))
{
   RenderSettings.skybox = sky2;
}

if(GUILayout.Button ("Sky 3"))
{
   RenderSettings.skybox = sky3;
}

}

```
