Emitters...
-
Hi, naththagr8 here. I'm working with emitters (they emit when I press a key). And I'm wondering if there is a way to have them emit only once when I press the key. I don't want to change the rate because i may want to press they key quickly. Currently I'm doing: (0.0-key("e"))*-80
Also, is there a way to delay a emitter? Like, I press the key and one second later it starts emitting. -
I made a script a while ago; it toggles a variable, but the main thing is it detects single key presses. This should do it:
if frame==1;setVar("repeat",0);end;if key("e")==0;setVar("repeat",1);0;elsif getVar("repeat")==0;0;else;setVar("repeat",0);80;end;
-
Thanks a lot. It's just what I needed. One problem.... It seems that I can only have one of those codes turned on in the model. I need 15 on. When I have five objects with that code turned on (each with their different key changed from "e" (q,w,e,r,t)) they emit constantly when I hold the key. I'm using the keys q-p, a-l, c-n,space. I'm working on my rock band model if you haven't figured it out. I'm putting the code in "strength" if that means anything.
-
@naththagr8 said:
Thanks a lot. It's just what I needed. One problem.... It seems that I can only have one of those codes turned on in the model. I need 15 on. When I have five objects with that code turned on (each with their different key changed from "e" (q,w,e,r,t)) they emit constantly when I hold the key. I'm using the keys q-p, a-l, c-n,space. I'm working on my rock band model if you haven't figured it out. I'm putting the code in "strength" if that means anything.
if your going to have fifteen different toggle scripts in your model, you'll need to give the setVars and getVars a different name. example:
if frame==1;setVar("rep",0);end;if key("o")==0;setVar("rep",1);0;elsif getVar("rep")==0;0;else;setVar("rep",0);80;end;
-
That worked. thanks! i just want to know the last part of my original post:
@unknownuser said:Also, is there a way to delay a emitter? Like, I press the key and [so many frames] later it starts emitting.
I'm using the same code: (0.0-key("e"))*-80
rate:1I suppose there's no way to keep emitted objects going on a straight line at the same speed?
Advertisement