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

Question Particles Disappear too quickly only when Gravity or Force Modifier is On

Discussion in 'General Graphics' started by jf065d, Aug 2, 2023.

  1. jf065d

    jf065d

    Joined:
    May 28, 2018
    Posts:
    22
    Problem Overview:
    I have a very basic Particle System attached to a prefab object. If I call the particle's mainmodule via a script attached to the object (ParticleSystem.MainModule), the object's StartLifeTime is seemingly impacted, and the particle effects disappear prematurely. But it's only impacted if the Gravity Modifier or Force Over Lifetime are active and set high enough (e.g. In the example below, Force Over Lifetime was set to -100).

    I've also tried setting the mainmodule's StartLifeTime (and duration) during runtime, but received an error "Setting the duration while system is still playing is not supported. Please wait until the system has stopped and all particles have expired or call Stop with ParticleSystemStopBehavior.StopEmittingAndClear to completely stop the system."

    I'm completely stumped why the particles are disappearing early in the game/game window but not from the scene.

    upload_2023-8-2_8-31-13.png

    upload_2023-8-2_8-31-41.png
     
    Last edited: Aug 2, 2023