Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

Changing skybox at runtime

Discussion in 'Unity 5 Pre-order Beta' started by DanSuperGP, Jan 9, 2015.

  1. DanSuperGP

    DanSuperGP

    Joined:
    Apr 7, 2013
    Posts:
    408
    Is it possible to change the skybox at runtime?

    Basically I want to reassign the field in the Lighting menu, Scene tab, Environment Lighting, Skybox...

    To a procedural skybox that I've loaded from Resources.
     
  2. AustinRichards

    AustinRichards

    Joined:
    Apr 4, 2013
    Posts:
    321
    RenderSettings.skybox = (Material) Resouces.Load("Skybox_Mat");
     
    DanSuperGP likes this.
  3. DanSuperGP

    DanSuperGP

    Joined:
    Apr 7, 2013
    Posts:
    408
    Oh, cool, it does work...

    I was doing

    RenderSettings.skybox = Resources.Load<Skybox>("Skybox").material;

    Which looks valid but didn't work.
     
  4. AustinRichards

    AustinRichards

    Joined:
    Apr 4, 2013
    Posts:
    321
    :-D! Glad your issue is fixed.
     
  5. DanSuperGP

    DanSuperGP

    Joined:
    Apr 7, 2013
    Posts:
    408
    Hmm, but the reflected colors on my objects don't change with it.
     
  6. DanSuperGP

    DanSuperGP

    Joined:
    Apr 7, 2013
    Posts:
    408
    Oh, but they do if I add a real time reflection probe... no worries then.