1

I have a problem with the following unity code .

private ParticleSystem instantiate(ParticleSystem prefab, Vector3 position)
{
    ParticleSystem newParticleSystem = Instantiate(
      prefab,
      position,
      Quaternion.identity
    ) as ParticleSystem;

    // Make sure it will be destroyed
    Destroy(
      newParticleSystem.gameObject,
      newParticleSystem.startLifetime
    );

    return newParticleSystem;
}

in the line

newparticlesystem.startlifetime 

I get the following error, which I do not understand.

"newparticlesystem.startlifetime" is obsolete 
 startlifetime property is deprecated.
derHugo
  • 83,094
  • 9
  • 75
  • 115
  • You cant use `startLifetime` nomore. All You gonna do is change your `newParticleSystem.startLifetime` to `newParticleSystem.main.startLifetime.constantMin` or `newParticleSystem.main.startLifetime.curveMin` It depends on what start lige time settings Your are using in this Particle System Object – selezen88 Jan 13 '21 at 08:45

0 Answers0