Reader small image

You're reading from  Build Stunning Real-time VFX with Unreal Engine 5

Product typeBook
Published inMay 2023
PublisherPackt
ISBN-139781801072410
Edition1st Edition
Concepts
Right arrow
Author (1)
Hrishikesh Andurlekar
Hrishikesh Andurlekar
author image
Hrishikesh Andurlekar

Hrishikesh Andurlekar is the founder of Tplusplus Interactive, an Unreal Authorized instructor, owner of a Unreal Authorized training center and a Mentor at Mastered UK. He has been a CG Supervisor at Prana Studios and Pixion. He has been working as a contractor/consultant in Unreal Engine for 6 years with leading companies including Reliance Jio Studios, Monk Studios, Prime Focus and True Telecom delivering Games, Simulations, Virtual Production Solutions and AR/VR experiences. He has trained companies around the world through Epic Games. More than 3200 hours of 1-2-1 training conducted for major companies like Technicolor, Yashraj studios, Infosys, Tech Mahindra, TCS, Aptech among others.
Read more about Hrishikesh Andurlekar

Right arrow

Events and Event Handlers

In this chapter, we will learn about Events and Event Handlers. This feature in Niagara allows different emitters to communicate with each other to drive effects dependent on each other. This makes it possible to build interesting effects. We will see some of the particle behaviors we can build with Events and Event Handlers. We will understand this through tutorials in which we will create fireworks, raindrops, and rocket trail behaviors.

In this chapter, we will cover the following topics:

  • What are Events and Event Handlers?
  • Tutorial – how to create fireworks

Technical requirements

Unreal Engine 5.1 and above is required for this chapter. The installation procedure was already explained in Chapter 1.

You can find the project we worked on in this book here:

https://github.com/PacktPublishing/Build-Stunning-Real-time-VFX-with-Unreal-Engine-5

What are Events and Event Handlers?

As we write complex particle systems, for them to work, we will need to have multiple emitters in a system interact with each other. For example, when creating a firework effect, when the particles that streak into the sky from the ground die, they should spawn a secondary sparkling effect. With raindrops, when each water particle hits the ground, it should spawn a splashing particle effect. Events and Event Handlers enable us to achieve these kinds of effects. Particles generate specific Events that occur in the lifetime of the particle. Event Handlers listen for those Events and respond to them. The response may be in the form of property or behavior changes or the spawning of particles. For example, in the case of raindrop effects, the water particle, on hitting the ground, generates a Collision event. This triggers the Event Handler to spawn secondary particles, which create a splashing effect.

Events work only with CPU simulations. We also...

Tutorial – how to create fireworks

In the following tutorial, we will create fireworks using all three event modules. Let’s get started:

  1. Let us create a new folder called EventDispatcher and in this folder, let us create two emitters. Let us name the first emitter Receiver and the second emitter Sender.

Figure 9.1: Creating two emitters called Receiver and Sender

We will use the Fountain template for the Sender emitter.

Figure 9.2: The Fountain template for Sender

And we’ll use the Omnidirection Burst template for the Receiver emitter.

Figure 9.3: The Omnidirectional Burst template for Receiver

We have named these emitters in this way so that we can understand which emitter will generate the Events (Sender) and which emitter will receive them (Receiver). Feel free to use any names you find convenient as they have no bearing on the functionality.

Figure 9...

Summary

In this chapter, we became familiar with useful features in Niagara called Events and Event Handlers. This enabled us to connect emitters and have one emitter drive the other emitter’s effects. We saw some functional examples of how to implement this feature.

We have been working on the creation part of Niagara until now. During development, we also need to figure out any bugs that creep into our particle systems, as well as keep an eye on the efficiency of the particle system.

In the next chapter, we will learn some debugging tricks to help enhance the performance of a Niagara System and ways to monitor it.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Build Stunning Real-time VFX with Unreal Engine 5
Published in: May 2023Publisher: PacktISBN-13: 9781801072410
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $19.99/month. Cancel anytime

Author (1)

author image
Hrishikesh Andurlekar

Hrishikesh Andurlekar is the founder of Tplusplus Interactive, an Unreal Authorized instructor, owner of a Unreal Authorized training center and a Mentor at Mastered UK. He has been a CG Supervisor at Prana Studios and Pixion. He has been working as a contractor/consultant in Unreal Engine for 6 years with leading companies including Reliance Jio Studios, Monk Studios, Prime Focus and True Telecom delivering Games, Simulations, Virtual Production Solutions and AR/VR experiences. He has trained companies around the world through Epic Games. More than 3200 hours of 1-2-1 training conducted for major companies like Technicolor, Yashraj studios, Infosys, Tech Mahindra, TCS, Aptech among others.
Read more about Hrishikesh Andurlekar