This should be an easy one but I’m pretty new to scripting. I’ve created several materials in unity. I’m trying to add a material to a game object ( its a initiated prefab) via scrip. At some point I want a different material randomly add to each instance. But for now, I’m just trying to get it to work with one material. Here is my script thus far:
#pragma strict
function Update ()
{
Material.GameObject.Find(Laser_Blue01);
}
This gives me the following errors:
Assets/Scripts/laserColor.js(7,18): BCE0019: ‘GameObject’ is not a member of ‘UnityEngine.Material’.
Assets/Scripts/laserColor.js(7,34): BCE0005: Unknown identifier: ‘Laser_Blue01’.
Anyone have any ideas?