Hi!
I try to do the following:
If my object has a collision, I want to Instantiate a ParticleSystem Prefab.
This Prefab already has a Material assigned with the Shader “Particles\Alpha blended”.
Now after instantiating I change the Texture of the Material with the following Code:
newInstance.GetComponent().material.mainTexture = myTextures*;*
However the particles stay white. And if I check in the Inspector at runtime, there are two Materials now: The existing one of the Prefab with no Texture, and a new one with the wrong Shader and the Texture I just assigned. See attached Image.
How can I implement it that I can assign a different Texture for every new ParticleSystem Prefab I instantiate?
Many thanks in advance!
Best regards