Search Unity

Question smooth change SkyBox

Discussion in 'Global Illumination' started by Zimaell, Apr 13, 2023.

  1. Zimaell

    Zimaell

    Joined:
    May 7, 2020
    Posts:
    409
    I need to smoothly change the SkyBox to another one, I found an example on the net, all the examples are the same, I made the same one for myself

    Code (CSharp):
    1. if(t < 1f){
    2.     Debug.Log("t => " + t);
    3.     t += 0.5f * Time.fixedDeltaTime;
    4.     if(t >= 1f){ t = 1f; }
    5.     RenderSettings.skybox.Lerp(OldSkyBox, NewSkyBox, t);
    6.     }
    but it changes sharp, what could be wrong?
     
    Last edited: Apr 13, 2023