Create a Beam Effect in Niagara

This page shows how to create a beam effect that simulates lightning.

Choose your operating system:

Windows

macOS

Linux

Prerequisite Topics

In order to understand and use the content on this page, make sure you are familiar with the following topics:

Prerequisite Step: This how-to uses the DefaultRibbonMaterial, which is included in the content for the Niagara plugin. However, you can use the M_Balloon material used in the Create a Mesh Particle Effect how-to if you have already completed that tutorial.

In Niagara, the Ribbon Renderer is used along with specific modules that indicate that the ribbon is being used as a beam. In this guide, you will learn how to create a beam that simulates lightning.

Create System and Emitter

In Niagara, systems and emitters are independent. The current recommended workflow is to create a system from existing emitters or emitter templates.

  1. First, create a Niagara System by right-clicking in the Content Browser, and selecting FX > Niagara System . The Niagara Emitter wizard displays.

    Click image for full size.

  2. Select New system from selected emitters . Then click Next .

    Click image for full size.

  3. Under Templates , select Static Beam .

    Click image for full size.

  4. Click the Plus sign ( + ) icon to add the emitter to the list of emitters to add to the system. Then click Finish .

    Click image for full size.

  5. Name the new system BeamSystem . Double-click to open it in the Niagara Editor.

Name System

  1. The emitter instance in your new system has the default name of StaticBeam , but you can rename it. Click the name of the emitter instance in the System Overview, and the field will become editable. Name the emitter FX_Beam .

    Click image for full size.

Change Renderer Settings

The Render group is last in the stack, but you need to change some things so that the effect displays the way it is supposed to.

  1. In the System Overview , click Render to open it in the Selection panel.

    Click image for full size.

    The emitter template in this system already has a ribbon renderer included. You will add specific modules later in this guide to indicate that the ribbon is used as a beam.

  2. The Material used for this renderer is the DefaultRibbonMaterial . If you want to use a different material, you can click the dropdown to search for and select that Material.

  3. If you scroll past the settings in the Ribbon Rendering section, you will find a section called Tessellation . In that section, set the Curve Tension to .5 . This will affect how spikey the lightning effect is. You can raise or lower that value to vary your effect.

    Click image for full size.

  4. Drag your **BeamSystem into your Level.

    When you make a particle effect, it is always a good idea to drag your system into a Level. This gives you a chance to see every change and edit in context. Any changes you make to the system automatically propagate to the instance of the system in your Level.

Edit the Emitter Update Group Settings

First, you will edit the modules in the Emitter Update group. These are behaviors that apply to the emitter, and that update each frame.

  1. In the System Overview , click the Emitter Update group to open it in the Selection panel.

    Click image for full size.

  2. The Static Beam emitter template has the Life Cycle Mode set to Self by default. This means the life cycle and loop behavior of the emitter is set directly, instead of being handled by the System. For this effect, you will add some randomness to the Loop Duration by adding a float to the value. Click the dropdown arrow for Loop Duration , and select Dynamic Inputs > Random Ranged Float . This adds Minimum and Maximum fields under Loop Duration.

    Click image for full size.

  3. Set the Loop Duration Minimum and Maximum values to the following.

    Click image for full size.

    Setting

    Value

    Minimum

    .1

    Maximum

    .2

  4. The first module that indicates this effect uses a beam is the Beam Emitter Setup module. Since you started with the Static Beam template, this module is already included. For Beam Start and Beam End , leave the position at its default. Check the boxes to enable Absolute Start and Absolute End . The start position of the beam is defined by the position of the Niagara system in the scene. The end position is defined by the static coordinates set in Beam End.

    Click image for full size.

  5. To add an arc or curve to the effect, check the box to enable Use Beam Tangents . This displays the Beam Start Tangent and Beam End Tangent settings. Click the Reset to Default (small yellow arrow) icon for Beam Start Tangent to change the value to Multiply Vector by Float . The Beam End Tangent is already set to Multiple Vector by Float. Set the Beam Start Tangent Vector and Float to the following values.

    Click image for full size.

    Setting

    Value

    Vector

    X : 0, Y : 0, Z : 1

    Float

    .5

  6. Set the Beam End Tangent Vector and Float to the following values.

    Click image for full size.

    Setting

    Value

    Vector

    X : 0, Y : 0, Z : 1

    Float

    1

  7. In the Spawn Burst Instantaneous module, set the Spawn Count to 35 .

    Click image for full size.

Edit the Particle Spawn Group Settings

Next, you will edit the modules in the Particle Spawn group. These are behaviors that apply to particles when they first spawn.

  1. In the System Overview , click the Particle Spawn group to open it in the Selection panel.

    Click image for full size.

  2. In the Initialize Particle module, locate the Lifetime parameter. This parameter determines how long particles will display before they disappear. Set the Lifetime to .2 . This short Lifetime will cause the beam to flicker, which will make the lightning more realistic.

    Click image for full size.

  3. The Spawn Beam module is the second beam-specific module. You do not need to set anything with this module, it just needs to be present.

  4. The third beam-specific module is the Beam Width module. The Beam Width is set to Float from Curve . Click the second curve key to display the Time and Value fields. Set the Time to .5 and the Value to 1 . To make the shape look right, right-click each curve key and make sure it is set to Auto .

    Click image for full size.

  5. Below the Curve diagram you will see some additional settings. Set the Scale Curve to 5 .

Edit the Particle Update Group Settings

Now you will edit the modules in the Particle Update group. These behaviors apply to an emitter's particles and update each frame.

  1. In the System Overview , click the Particle Update group to open it in the Selection panel.

    Click image for full size.

  2. In the Color module, set the RGB values to the following.

    Click image for full size.

  3. To break up the curve and make the beam crackle and jump like lightning, add the Jitter Position module by clicking the Plus sign ( + ) icon for Particle Update and selecting Location > Jitter Position .

    Click image for full size.

  4. To make the Jitter Position module work correctly, you need an Update Beam module. Add the Update Beam module by clicking the Plus sign ( + ) icon for Particle Update and selecting Beam > Update Beam . In the System Overview , drag the Update Beam module to a position above the Jitter Position module in the stack.

    Click image for full size.

  5. Now go back to the Jitter Position module. The default setting for Jitter Amount is 10 , and the default for Jitter Delay is .25 . However, if you decrease the Jitter Delay to .1 you will start to see the beam bend with an angular, jagged motion. With the value at .1 you can still see the original arc shape under the jagged beam, which is not ideal. To fix this, you have to set the Jitter Delay to a negative number. Set the Jitter Delay to -.01 . Set the Jitter Amount to 15 .

    Click image for full size.

End Result

Congratulations! You have created a beam effect that simulates lightning. In the video below, you can see an example of the lightning beam effect. You can use beams for all kinds of visual effects: lasers, weapon rays, tesla coils and so on.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss