PopcornFX v2.14

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
  1. Home
  2. Docs
  3. PopcornFX v2.14
  4. Plugins
  5. O3DE Gem
  6. Event Buses
  7. Emitter Component Events

Emitter Component Events

The Emitter component events bus is used to get notifications in the engine for certain events happening to the PopcornFX emitter.

Bus events

Return typeDescription
voidOnFxCreated(const AZ::EntityId &entityId)
Triggered when the effect attached to the entity has been created.
entityId is the identifier of the parent entity.
voidOnFxDisabled(const AZ::EntityId &entityId)
Triggered when the effect attached to the entity has been disabled.
entityId is the identifier of the parent entity.

Warning: This function is not completly implemented for now.
voidOnFxBroadcastEvent(const AZ::EntityId &entityId, SBroadcastParams *broadcastParams)
Triggered when an effect export an event to the game engine. SBroadcastParams contains the exported event name.
In this callback, you can use the PopcornFXIntegrationBus::Handler::GetCurrentPayloadValue to retrieve the current event payloads (values transferred from the PopcornFX nodegraph to the engine).

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.

Was this article helpful to you? Yes No

How can we help?