I’ve created “laser fire” that’s instantiated from a prefab. My next step is to have each laser shot be one of six materials (differ color materials) that I’ve already created, be randomly applied to each shot that instantiated.
I’m pretty new to scripting, if anyone has any suggestions on some starting points with this, I would love to hear them!
there’s an example on the Renderer.material reference page: Unity - Scripting API: Renderer.material
it’s not quite what you need, but it’s a good start.
You can get a “one of these” by using Random.value Unity - Scripting API: Random.value
You should use Random.Range, not Random.value (well, you can get that to work but there’s no point when Random.Range exists).
–Eric