Hi,
I wanted to put a changing color background in my game, and have done it with the main camera.
I edited the basic Unity Script Reference script to add more colors, and it came up with this error:
Assets/Standard Assets/Scripts/Camera Scripts/Camera Colour Strobe.js(15,45): BCE0017: The best overload for the method ‘UnityEngine.Color.Lerp(UnityEngine.Color, UnityEngine.Color, float)’ is not compatible with the argument list ‘(UnityEngine.Color, UnityEngine.Color, UnityEngine.Color, UnityEngine.Color, float)’.
Here is my edited script:
#pragma strict
// ping-pong animate background color
var color1 : Color = Color.red;
var color2 : Color = Color.blue;
var color3 : Color = Color.yellow;
var color4 : Color = Color.green;
var duration = 3.0;
// Set clear flags to color
camera.clearFlags = CameraClearFlags.SolidColor;
function Update () {
var t : float = Mathf.PingPong (Time.time, duration) / duration;
camera.backgroundColor = Color.Lerp (color1, color2, color3, color4, t);
}
Can someone help me?
Thanks,
TheThingThatDies
PS. If you see the same thing on the Answers site. I went to the wrong place.