|Name of gadget||Emitter|
|Section||Movers & Outputs|
|Number of Tweak pages||2|
|Last updated||19 Mar 2019 [Beta]|
This gadget will cause clones of a chosen template object to be emitted from a chosen position using a gizmo. It can be projected away or created on the spot, and can be done once or numerous times. You can choose how many copies are emitted at any one time. It is used for all sorts, such as guns, spawning points, effects and collectables.
Example Tutorial (adapted from Media Molecule)
- Stamp a cube
- Stamp an emitter
- Stamp a controller sensor
- Set the controller sensor to remote controllable
- Connect the R2 output to the power port on the emitter
- Tweak the emitter and set emit mode to once
- Choose the cube as the object to emit.
- Use start time and press R2 to emit a cube.
Click on arrows to reveal
Tweak Menu 1: Properties
- Menu page indicator
- Object to Emit
Click on this and then attach the dashed line to any element in your scene to select it as the template object for the gadget to emit. Note that when you select your template, it remains in the scene, associated with the emitter, but will now be invisible (when not selected) and will not appear separately in play mode.
You can still drill down into the template to make changes – you may need to turn off the ‘Preview Invisibility’ option (Show/Hide tools) to see the original object. You can even move the template around once selected; it will still emit from the same place – the relative position of emitter and emitted object remains as it was initially set (you can change it by dragging its gizmo handle).
- Emit Speed
Use this to set the emission speed for your object in metres per second. A gizmo handle on the template allows you to specify the direction.
- Rotation Speed
Use this to set the rotational speed of your emitted object in degrees per second. Again there is a gizmo handle so you can choose which way your object is going to spin when it is emitted.
- Ignore Parent Speed
This setting allows you to choose whether or not the speed of the emitter itself affects the speed of the objects it emits. For example if you were using an emitter moving along an erratic path to drop snowflakes in “random” places, use this option to stop each snowflake being thrown along the emitter’s current direction.
- Time Between Emits
Use this to specify how often the emitter can emit an object. Remember that an emitter emits first as soon as it is activated, so if the Time Between Emits is 1.0s (and you are emitting continuously), you’ll get one object immediately, the second at 1.0s, the third at 2.0s and so on.
- Emit Mode
Select this option if you want the emitter to emit a single object when powered on. To emit another object from this emitter it will be necessary to send an off signal to the Power input first. This is useful for things like emitting an object whenever the player presses a button.
Select this option if you want the emitter to emit objects repeatedly, at regular intervals, for as long as it is powered on (and the maximum number of objects has not been reached).
- Local Space
By default, directions are calculated within the global scene space that is shared throughout the scene. Activated this instead if you prefer the emitter to work in its own “Local Space”, i.e. to have the direction of emission dependent on the emitter’s orientation.
- Emitted Object Lifetime
Select a lifetime for your emitted objects: this can be set to infinite (∞), then anywhere from 0.1s upwards. Once the objects have existed for this length of time, they will automatically be deleted from your scene. If you’re emitting a lot of objects which don’t remain in view (spaceship weapons for example), it’s a useful way to keep their numbers down at any given point, which improves the performance of your scene.
- Max Emitted at Once
Use this to specify the maximum number of objects that the emitter can have emitted into the scene at any one time. Set this to infinity (∞), or any number from 1 upwards. Once the number of emitted clones in your level reaches this number, the emitter will stop emitting until the number is reduced in some way. Consider limiting the number of things that can be emitted to improve the performance of your scene.
- Max Emitted
Use this to specify the maximum number of objects that your emitter can emit in total, regardless of how many there are currently in your scene. Once this is reached, the emitter will no longer emit objects. You might use this to stop players from “farming” an area of your game for resources – have one emitter give up its goodies a maximum number of times and then stop. Again, this can be set to infinity (∞), or any number from 1 upwards.
- Recycle Emitted Objects
When this is activated in combination with “Max Emitted At Once”, when the maximum output number is reached, your emitter will be able to continue emitting objects but only by destroying the oldest copies, one at a time. Each newly emitted object replaces the oldest copy left in the scene.
This is where you turn the gadget on/off
Tweak Menu 2: Inputs & Outputs
- Menu page indicator
- Object Just Emitted
This output sends a pulse signal every time an object is emitted. You’d use this for example if you want the emitter to make a sound effect with every emission. This is better than triggering the sound effect alongside the emitter because this output will take into account whether the emitter cannot emit an object due to maximums being reached.
- Scene Space Direction
Use this input to specify a direction for the object to be emitted in. [Some experimentation required to determine the input signal type! TBA – QW]
- Scene Space Translation
Use this input to specify a relative location for the object to be emitted at. [Presumably a “Transform” fat wire.]
- Destroy Emitted Objects
Input a signal here to destroy all objects that have been created by this emitter in the current scene.
- Emit With Wires
Toggle this to specify whether the objects that you emit will include wire connections – this is only relevant if your template object has wired connections to other objects in your scene.
This is where you turn the gadget on/off
See How to make an exploding rock for an example using an emitter to emit rock fragments in a specific location (among other things).