Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Unity 5.3 how to change dampen on particle system collision module?

Discussion in 'Scripting' started by Tongie, Dec 10, 2015.

  1. Tongie

    Tongie

    Joined:
    Sep 19, 2012
    Posts:
    90
    how to change dampen on collision module? the collision module is a readonly?


    particleWater.collision.dampen = new ParticleSystem.MinMaxCurve(0.1f, 0.2f);
    particleWater.collision.lifetimeLoss = 0.2f;

    error CS1612: Cannot modify a value type return value of `UnityEngine.ParticleSystem.collision'. Consider storing the value in a temporary variable
     
  2. Tongie

    Tongie

    Joined:
    Sep 19, 2012
    Posts:
    90
    Anyone able to do this?
     
  3. ThermalFusion

    ThermalFusion

    Joined:
    May 1, 2011
    Posts:
    906
    Store particleWater.collision in a temporary value and edit that.