- Home /
how do you change a skybox material by name
I have a skybox component attached to a camera. I want to change the skybox material from "Blue sky" to "Sunset" in a script.
In the inspector for skybox Blue sky is checked as material. When I open up materials I also see "Sunset" as another skybox material.
How do I change the skybox material if I have the name
WorldCamera.GetComponent(Skybox).material="Blue sky"; //does not work.
Comment
Answer by Seth-Bergman · Jul 20, 2012 at 07:35 AM
http://forum.unity3d.com/threads/125672-Changing-Skybox-material-through-script
http://answers.unity3d.com/questions/57214/assign-skybox-in-script.html
resources load is the only way to change a texture by name?