The Emitter component events bus is used to get notifications in the engine for certain events happening to the PopcornFX emitter.
Warning: This function is not completly implemented for now.
In this callback, you can use the
Use in script canvas
You can also retrieve the events exported from a PopcornFX effect in the O3DE script canvas.
Here, in the PopcornFX editor, we create a simple particle layer that triggers an event on particle death. We specify the particle position as an input to the “OnDeath” event trigger node so that it is added as a payload:
In the root layer graph, we also output this event:
The event should appears in the “Effect Interface” panel:
We import this effect in O3DE, make sure it plays properly and add a “Script Canvas” component to the emitter entity:
Let’s create a new script canvas source file. We will use it to spawn the same effect at the location where each particle dies:
In this script canvas, we start by retrieving the event broadcasted from PopcornFX using the “PopcornFXBroadcast” node and then we use the “PopcornFXExtractPayload” node to get the “Position” payload from the particle graph.
We can then easily use this payload to spawn another effect at the location where the particles are dying:
When playing the game (CTRL+G in O3DE), we now have the same effect spawning at the locations where each one of the particle dies:
This is a very simple example of how to use this feature, but this can be used for gameplay interactions and many other purposes in your projects.