The smoke gun component is an simple example script. It simply spawns set objects into the scene but if those objects have a MegaFlow component attached then they will interact with the selected MegaFlow source and be moved around the scene. This is a simple way to test a flow source with set objects. The physics values for this component will be applied to each object spawned into the scene so you can quickly adjust the settings and see the result. You can select multiple objects to be spawned and those objects could have either the MegaFlow RBody component attached or the MegaFlow Effect component. If you select an object which does not have either of those components attached then the object will just be spawned into the scene and not move.
This script also allows the emitter object to be controlled by a mouse, when the scene is run holding down the left mouse button and moving the mouse will move the emitter, you can adjust the mouse sensitivity by changing the x and y speed values in the inspector.
MegaFlow Smoke Gun Params
The following params control the behaviour of the object spawning and the movement of those objects through the flow.
The MegaFlow source to use to control the flow of the spawned objects.
If the flow source has multiple frames for fluid data then you can select the frame to use here. Changing this value at runtime will only effect newly spawned objects, existing objects will continue to use the frame they were spawned with until their life runs out.
The time gap between spawning objects, the lower the value the faster objects will be spawned.
How many object will be spawned each time.
The starting velocity of the new objects.
A multiplier for the effective force of the flow field on the objects.
The mass of each object spawned. The lower this value the more effect the flow field will have on the movement of the object.
The area value for the objects spawned, the larger this value the greater the influence of the flow field on the objects movement.
Gravity value to use in the physics.
The life span of the object in the scene, the higher this value the longer the objects will exist in the flow.
The width of the emitter. Objects are spawned randomly within the limits of the width and height values.
The height of the emitter. Objects are spawned randomly within the limits of the width and height values.
The starting pool size for objects to use by this component.
The sensitivity of the mouse movement in the x direction.
The sensitivity of the mouse movement in the y direction.
Click this button to add a new object to the spawn list.
Selects the object to be spawned. This object should have either a MegaFlow Effect or MegaFlow RBody component attached to it. Click the D button to remove an object from the list.