- Home /
Change colour of particle system upon collision
I want the colour of my particle system to change when it collides with another object. How can I do this based in the 2020.3 Unity version? I've already set the start colour. I've tried using
ps = GetComponent();
Color color = new Color32(141, 224, 179, 125);
main.startColor = color;
and
ps.getComponent();
colorModule = ps.colorOverLifetime;
colorModule.color = ParticleSystem.MinMaxGradient(Color.green);
Answer by Rechronicle · Oct 17, 2021 at 12:23 PM
you can use OnParticleCollision() and change the color from there. It's a bit similar with OnCollisionEnter() and available in MonoBehaviour.
Your answer
Follow this Question
Related Questions
GUI Colour based on Health? 1 Answer
How to colour individual labels with UnityScript? 2 Answers
unity png color bleeding 1 Answer
Linear Color Space washed out in android URP build. 2 Answers
Modifying Greyscale Shader for selective Colouring. 2 Answers