I use a script for spawning characters and I want each character to use a different material, so all of they look different. Materials are stored as a jpg files in my projects.
What are the ways to make this work?
IEnumerator InstanceSpawner()
{
yield return new WaitForSeconds(0);
while (!stop)
{
RandomHuman = Random.Range(0, 2);
Vector3 SpawnPosition = new Vector3(Random.Range(-SpawnValues.x, SpawnValues.x), 1, Random.Range(-SpawnValues.z, SpawnValues.z));
Instantiate(humans[RandomHuman], SpawnPosition + transform.TransformPoint(0,0,0), Quaternion.Euler(0,90,0));
yield return new WaitForSeconds(SpawnWait);
}
}
}