Hello,
I have massive problems accessing a particle system through a script.
What I want:
a particle system that spawns particles continuously which then go in a line to the right. When dragging a GUI slider the speed or the size of the particles should change.
What I have:
GUI slider is no problem,I also managed to create the particle system in the scene and it looks fine with the settings I gave it in the instructor. I called this particle system ‘Spawner’. I also created a C# script called ‘mosfetlogic’ which I use to show the GUI slider and which should access the particle system.
But this is where I get stuck and I cannot seem to find any useful tutorial/example to access it.
I do not need to access each particle on its own, just the basic values that I can change in the instructor. Right now I am really confused from all the different examples that I tried and didn’t work so I don’t even know where to start with the particle system.
Please help me if you have any clue, I am going crazy over this.
This is the code I have now, I want to use val to change values in the particle system:
using UnityEngine;
using System.Collections;
public class mosfetlogic : MonoBehaviour {
private float val, tVal, bVal;
private Rect rect = new Rect(25, 25, 10, 300);
// Use this for initialization
void Start () {
val = 1.0F;
tVal = 3.0F;
bVal = 0F;
}
void OnGUI(){
val = GUI.VerticalSlider(rect, val, tVal, bVal);
}
}