- Home /
Making a Shuriken Particle System Turn on and off.
Yeah, I've heard that the new Particle System is really hard to work...
So, I'm making the Lunar Lander game from UnityCookie's tutorial. I have placed my four thruster particle systems on my ship, and turned the emit value to off. So now I should be able to turn the emit value on and off, right? I want to have the particle system "Emission" box to be checked when I hit the arrow keys. Here is the script I have, but it keeps giving me the "NullReferenceException: Object reference was not set up to an instance of an Object"
var leftThurster : ParticleSystem;
function Start () { }
function Update () {
if(Input.GetAxis("Horizontal") > 0) //Pressed Right
{
leftThurster.ParticleSystem.enableEmission = true;
}
Answer by DaveA · Mar 04, 2013 at 11:13 PM
See here: http://docs.unity3d.com/Documentation/ScriptReference/ParticleSystem.Stop.html
and your code would be
leftThurster.enableEmission = true;
And you might want to spell it
leftThruster
Thanks abunch, I thought I had tried that already, but maybe my spelling was off..cause my spelling is really bad (as you can see)