I want to change my particle system at runtime for values like Start Lifetime or Start color but it seems that most of the particle system cannot be modified (get only).
Is there a way change particle systems at runtime?
I want to change my particle system at runtime for values like Start Lifetime or Start color but it seems that most of the particle system cannot be modified (get only).
Is there a way change particle systems at runtime?
Hello FeastSC2
I believe you can do that. Check out the documentations example here
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour
{
private ParticleSystem ps;
public float hSliderValue = 1.0F;
void Start()
{
ps = GetComponent<ParticleSystem>();
}
void Update()
{
var main = ps.main;
main.startLifetime = hSliderValue;
}
void OnGUI()
{
hSliderValue = GUI.HorizontalSlider(new Rect(25, 45, 100, 30), hSliderValue, 0.0F, 5.0F);
}
}