no matter how hard i disable this particle system it still emits particles in a line when i move its transform.
heres my code:
function load()
{
boltParticles.emissionRate=0; // try to stop it from emitting by making it not emit.
boltParticles.enableEmission = false; // try to stop it from emitting by turning the emission off.
trailRender.enabled = false;
transform.position = hand.position; // move into position everything is off by this point. yet it still emits.
transform.rotation = hand.rotation;
boltParticles.Clear(); // i even clear the particles, and they still show up.
rigidbody.velocity=Vector3.zero;
}
function fire()
{
targetVec = pointer.position;
fired=true;
trailRender.enabled = true;
renderer.enabled = true;
boltLight.enabled = true;
collider.enabled = true;
boltParticles.emissionRate = BPEMRate; // set the emission rate back to normal
boltParticles.enableEmission = true; // turn it back on
}
function explode()
{
fired=false;
renderer.enabled = false;
collider.enabled = false;
rigidbody.velocity=Vector3.zero;
explodeParticles.Emit(20);
explodeLight.range=10;
}
code is ran in this order:
load >> fire >> explode
then it repeats if u click again.
i have come across this before, but i was always able to solve it by turning it back on **after** a yield waitForEndOfFrame();. but in this case i'm getting a bunch of coroutine errors, and that's over my head right now.
my question is this: is there any way to stop it from emitting during the re-position, without using coroutines?
↧