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.