Skip to main content

Search

How do I emit the number of objects in a variable?

  • TAPgiles

    I'd probably have a setup like this:

    A counter, with the target number wired into the target input. Wire the counter full output into a NOT gate. Use that to power the emitter. Use the emitter's "emitted object" output to wire into the counter's +, so it adds 1 every time something is emitted. Set the emitter to emit continuously with an interval of 0.

    So what should happen is, while the counter isn't at the target number, a new object is emitted each frame and 1 is added to the counter. Once the counter gets to the target number, it will no longer power the emitter and so not spit out any more objects.

  • RandomParrot

    Thanks worked perfectly!

    If anyone's wondering: for the one time activation I placed all the logic into a microchip, wired the button press into a signal manipulator set to 'toggle output at ON' and wired that into the microchip. So when the button is pressed the microchip powers on, activating the emitter inside until it reaches the maximum count in the variable and then shuts off.

  • TAPgiles

    ?

Please sign in to leave a comment.