Is there any way to control the time of a ParticleSystem through code? Just exactly like you can do it in the editor scene view. I for the life of me can’t find a way to mimic that behavior at runtime. Unfortunately I have a suspicion that unity hasn’t exposed enough of it’s API :(. This is the best I have come up with:
using UnityEngine;
[RequireComponent(typeof(ParticleSystem))]
public class ParticleSystemSampler : MonoBehaviour
{
public float playbackTime = 0f;
void Awake()
{
particleSystem.randomSeed = 1;
}
void Update()
{
particleSystem.Simulate(playbackTime, true, true);
}
}
It works great up until playbackTime surpasses the ParticleSystem’s startLifetime variable. At that point playbackTime becomes ineffective.
