How to Create a Beam Effect in Niagara

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

Windows
MacOS
Linux
Prerequisite Topics

This page assumes you have prior knowledge of the following topics. Please read them before proceeding.

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 Cascade, there was a special data type for beam effects. In Niagara, you use the Ribbon Renderer 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

Unlike in Cascade, Niagara emitters and systems 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.

[REGION:lightbox]
[![Create System Menu](CreateSystem_NewMenuSelections.png "Create System Menu")(w:400)](CreateSystem_NewMenuSelections.png "Create System Menu")
[/REGION]
[REGION:caption]
Click image for full size.
[/REGION]

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

[REGION:lightbox]
[![System Wizard New from Selected](CreateSystem_SystemWizard.png "System Wizard New from Selected")(w:400)](CreateSystem_SystemWizard.png "System Wizard New from Selected")
[/REGION]
[REGION:caption]
Click image for full size.
[/REGION]

1. Under Templates, select Static Beam.

[REGION:lightbox]
[![Select Static Beam Template](CreateSystem_SelectStaticBeam.png "Select Static Beam Template")(w:400)](CreateSystem_SelectStaticBeam.png "Select Static Beam Template")
[/REGION]
[REGION:caption]
Click image for full size.
[/REGION]

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

1. 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.

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.

1. 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. 1. 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.
1. Drag your **BeamSystem into 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.

1. 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 > Uniform Ranged Float. This adds Minimum and Maximum fields under Loop Duration.
1. Set the Loop Duration Minimum and Maximum values to the following.

REGION:simpletable

Setting

Value

Minimum

.1

Maximum

.2

1. 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.

1. 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.

REGION:simpletable

Setting

Value

Vector

X: 0, Y: 0, Z: 1

Float

.5

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

REGION:simpletable

Setting

Value

Vector

X: 0, Y: 0, Z: 1

Float

1

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

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.

1. 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.
1. 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. 1. 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.
1. 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.

1. In the Color module, set the RGB values to the following.
1. 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.
1. 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.
1. 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.

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.

Tags
Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback