Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    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.