Search Unity

Question Change Particle System Color by Speed module range in script

Discussion in 'Scripting' started by tillholzapfel, Mar 15, 2023.

  1. tillholzapfel

    tillholzapfel

    Joined:
    Oct 29, 2020
    Posts:
    4
    Hi everyone, I was trying to change the color by speed range via script the same way I do it with other modules and even though it does not throw an error it also seems to do nothing:
    Code (CSharp):
    1. var colorRange = m_ParticleSystem.colorBySpeed.range
    2. colorRange.y = .5f;
    colorbyspeed_script.png
    Ideally I would like to hook it to the current speed range that is displayed in the scene window during play mode, but I could not find information on how to easily access those values:
    particle_speed.png