Quantcast
Channel: Answers for "Changing Color of Tree Material"
Viewing all articles
Browse latest Browse all 4

Answer by joedrigon

$
0
0

Maybe check out the Unity reference for material below...

link text

// Fade the color from red to green
// back and forth over the defined duration
var colorStart = Color.red;
var colorEnd = Color.green;
var duration = 1.0;

function Update () {
var lerp = Mathf.PingPong (Time.time, duration) / duration;
renderer.material.color = Color.Lerp (colorStart, colorEnd, lerp);
}

Viewing all articles
Browse latest Browse all 4

Trending Articles