Activating FX Using Blueprints
Activate your effect with the press of a button using Blueprints.
Pressing a button to activate a Niagara FX in a game can be used for a variety of reasons. Whether you’re trying to indicate an ability or an action or just enhancing the gameplay experience for the player, we’ll show you how to activate your Niagara FX with the press of a button using Unreal Blueprints.
What is an Unreal Blueprint?
A Blueprint, or Blueprint Visual Scripting System, is a way to create complete gameplay elements through a node based interface. This system is extremely flexible and powerful as it provides the ability for designers to use virtually the full range of concepts and tools generally only available to programmers. Blueprints are created inside of Unreal Editor visually, instead of by typing code.
What is a Node?
Nodes are objects such as events, function calls, flow control operations, and variables, among others. These nodes can be used within graphs to define the functionality of a specific Blueprint and the associated gameplay elements it represents.
- Create a Blueprint and drag your Niagara effect into it.
- Turn off Auto Activate on the Niagara component.
- In the Event Graph, connect Event BeginPlay and Get Player Controller to the node Enable Input.
- Add a node for the keyboard button you would like to press.
- Drag the Niagara Component into the Event Graph and drag off that node to create the Activate node.
- Connect the Pressed output from the keyboard button node to the Activate node.
- Compile and Save your Blueprint.
- Drag the Blueprint into the world, press Play and then press your specified button.