I’m a Unity and scripting newbie and I’m stuck. I’m trying to create a fire extinguisher effect when I hold down the fire button, and when released, it stops.
I don’t think I need it instantiated, as it’s just on or off, not duplicating itself. Using the CreateParticleSystem.js as an example, I deleted the parts of the script to tell the particles where and how to emit from on a surface.
function Update () {
// Did the user press the mouse button?
if (Input.GetMouseButtonDown (0)) {
Instantiate (particleSystem);
}
}
But this doesn’t work, I just get an error-is there an easy way to turn the particles on/off per mouse button activation that I missed?
My goal is to run around using my fire extinguisher to extinguish objects that are on fire. Any other tips or hints??