I have script that changes a “lasers” color randomly with every shot (like in Bubble Shoot). That is the script below.
After having my game tested, it was suggested to me that I have some sort of preview (like in Bubble Shoot) as to what color the next laser will be. My thinking is to modify this script so that the preview generates a color every couple of seconds and then modify my laser firing script to based on the color of the preview.
So for starters, I’m just trying to get the preview to change randomly. Can anyone point me in the right direction?
(as a side note, the colors are choosin randomly from one of six materials I’ve made)
//Laser random color.
var myMaterials : Material[]; // assign in inspector
function Start ()
{
renderer.material = myMaterials[Random.Range(0, myMaterials.Length)];
}