Unity - Setting Skybox from script makes strange color

345 views Asked by At

I downloaded some skyboxes from the Unity Store to make a night scene.

By setting a night skybox, it makes it all dark and this worked great; nothing can be seen without a light source!

But I made a really simple script to just change the default skybox to the night one, which accomplishes this, but you can still see everything in a grayish color.

Code

using UnityEngine;
using System.Collections;

public class SceneEditor : MonoBehaviour {

    public Material skybox;

    void Start () {

        RenderSettings.skybox = skybox;
        RenderSettings.ambientSkyColor = skybox.color;
    }
}

Screen Shot

night sky

0

There are 0 answers