Hello,
I am new to Unity and I would like to select a group of more than 10 ParticleSystem, to go faster I use “[ ]” but I get an error when I add “[ ]” after ParticleSystem.
Here is the part of the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class OptionManager : MonoBehaviour
{
public Slider SliderParticle;
public ParticleSystem[] PS;
public float hSliderValue = 5.0f;
void Start()
{
var emission = PS.emission;
emission.rateOverTime = 0.0f;
}
void Update()
{
hSliderValue = SliderParticle.value;
var emission = PS.emission;
emission.rateOverTime = SliderParticle.value;
}
I’m trying to change the “rateOverTime” value of all the particles from a slider from 1 to 20