Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


duration

The duration of the Particle System in seconds.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.ParticleSystemModule
public float duration { get; set; }

Remarks

You can only set this property when the Particle System is not playing.

Examples

using UnityEngine;using System.Collections;[RequireComponent(typeof(ParticleSystem))]public class ExampleClass : MonoBehaviour{ private ParticleSystem ps; void Start() { ps = GetComponent<ParticleSystem>(); ps.Stop(); // Cannot set duration whilst Particle System is playing var main = ps.main; main.duration = 10.0f; ps.Play(); }}