gradual color transition from blue to black and back to blue

jorkosjorkos Member, PRO Posts: 353

Hey guys, i'm working on an endless flying game and I want the background color to slowly transition from daytime to nightime and back. I am using the scene color and it starts blue (RGB: 0.74,1,1). How would I gradually transition this color to black and back over a time period (say 120 seconds). Thank you so much for your help

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    You could use Interpolate Behaviors to interpolate the RGB values of the scene color over time. An alternate method would be to create an image and interpolate its alpha so it fades in and out to give you the color change.

  • SocksSocks London, UK.Member Posts: 12,822

    @jorkos said:
    How would I gradually transition a color to black and back over a time period (say 120 seconds).

    Make a black actor that fills the screen, then constrain this actor's alpha channel to:

    0.5 *sin( self.Time )+0.5

    This will take 120 seconds to go from blue to black and then back to blue again.

Sign In or Register to comment.